mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Add additional support code in ansible-test.
This commit is contained in:
@@ -32,13 +32,15 @@ from lib.util import (
|
||||
|
||||
class HttpClient(object):
|
||||
"""Make HTTP requests via curl."""
|
||||
def __init__(self, args, always=False):
|
||||
def __init__(self, args, always=False, insecure=False):
|
||||
"""
|
||||
:type args: CommonConfig
|
||||
:type always: bool
|
||||
:type insecure: bool
|
||||
"""
|
||||
self.args = args
|
||||
self.always = always
|
||||
self.insecure = insecure
|
||||
|
||||
def get(self, url):
|
||||
"""
|
||||
@@ -73,6 +75,9 @@ class HttpClient(object):
|
||||
"""
|
||||
cmd = ['curl', '-s', '-S', '-i', '-X', method]
|
||||
|
||||
if self.insecure:
|
||||
cmd += ['--insecure']
|
||||
|
||||
if headers is None:
|
||||
headers = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user