Modify incompatible default value passed to requests
This commit fixes incompatibility imported in
274dca0344
which
changes default value passed to requests module function.
Change-Id: I67663e6bd6e060f572e9c26cf504abd31ba49402
This commit is contained in:
parent
08db0e8eed
commit
0940a71737
|
@ -191,7 +191,7 @@ def elcm_request(irmc_info, method, path, **kwargs):
|
|||
'irmc_verify_ca': Either a boolean, in which case it controls
|
||||
whether we verify the server's TLS certificate,
|
||||
or a string, in which case it must be a path to
|
||||
a CA bundle to use. Defaults to ``True``.
|
||||
a CA bundle to use. Defaults to ``False``.
|
||||
...
|
||||
}
|
||||
:param method: request method such as 'GET', 'POST'
|
||||
|
@ -207,7 +207,7 @@ def elcm_request(irmc_info, method, path, **kwargs):
|
|||
userid = irmc_info['irmc_username']
|
||||
password = irmc_info['irmc_password']
|
||||
client_timeout = irmc_info.get('irmc_client_timeout', 60)
|
||||
verify = irmc_info.get('irmc_verify_ca', True)
|
||||
verify = irmc_info.get('irmc_verify_ca', False)
|
||||
|
||||
# Request headers, params, and data
|
||||
headers = kwargs.get('headers', {'Accept': 'application/json'})
|
||||
|
|
|
@ -264,7 +264,7 @@ def get_share_type(share_type):
|
|||
|
||||
|
||||
def scci_cmd(host, userid, password, cmd, port=443, auth_method='basic',
|
||||
client_timeout=60, do_async=True, verify=True, **kwargs):
|
||||
client_timeout=60, do_async=True, verify=False, **kwargs):
|
||||
"""execute SCCI command
|
||||
|
||||
This function calls SCCI server modules
|
||||
|
@ -279,7 +279,7 @@ def scci_cmd(host, userid, password, cmd, port=443, auth_method='basic',
|
|||
:param verify: (optional) Either a boolean, in which case it
|
||||
controls whether we verify the server's TLS certificate,
|
||||
or a string, in which case it must be a path to
|
||||
a CA bundle to use. Defaults to ``True``.
|
||||
a CA bundle to use. Defaults to ``False``.
|
||||
:returns: requests.Response from SCCI server
|
||||
:raises: SCCIInvalidInputError if port and/or auth_method params
|
||||
are invalid
|
||||
|
@ -496,7 +496,7 @@ def check_eject_fd_cmd(xml_cmd):
|
|||
|
||||
|
||||
def get_client(host, userid, password, port=443, auth_method='basic',
|
||||
client_timeout=60, verify=True, **kwargs):
|
||||
client_timeout=60, verify=False, **kwargs):
|
||||
"""get SCCI command partial function
|
||||
|
||||
This function returns SCCI command partial function
|
||||
|
@ -509,7 +509,7 @@ def get_client(host, userid, password, port=443, auth_method='basic',
|
|||
:param verify: (optional) Either a boolean, in which case it
|
||||
controls whether we verify the server's TLS certificate,
|
||||
or a string, in which case it must be a path to
|
||||
a CA bundle to use. Defaults to ``True``.
|
||||
a CA bundle to use. Defaults to ``False``.
|
||||
:returns: scci_cmd partial function which takes a SCCI command param
|
||||
"""
|
||||
|
||||
|
@ -583,7 +583,7 @@ def get_virtual_fd_set_params_cmd(remote_image_server,
|
|||
|
||||
|
||||
def get_report(host, userid, password,
|
||||
port=443, auth_method='basic', client_timeout=60, verify=True):
|
||||
port=443, auth_method='basic', client_timeout=60, verify=False):
|
||||
"""get iRMC report
|
||||
|
||||
This function returns iRMC report in XML format
|
||||
|
@ -596,7 +596,7 @@ def get_report(host, userid, password,
|
|||
:param verify: (optional) Either a boolean, in which case it
|
||||
controls whether we verify the server's TLS certificate,
|
||||
or a string, in which case it must be a path to
|
||||
a CA bundle to use. Defaults to ``True``.
|
||||
a CA bundle to use. Defaults to ``False``.
|
||||
:returns: root element of SCCI report
|
||||
:raises: ISCCIInvalidInputError if port and/or auth_method params
|
||||
are invalid
|
||||
|
@ -895,8 +895,9 @@ def get_firmware_upgrade_status(irmc_info, upgrade_type):
|
|||
'irmc_client_timeout': timeout, default is 60,
|
||||
'irmc_verify_ca': (optional) Either a boolean, in which case it
|
||||
controls whether we verify the server's TLS
|
||||
certificate, or a string, in which case it must be
|
||||
a path to a CA bundle to use. Defaults to ``True``.
|
||||
certificate, or a string, in which case it
|
||||
must be a path to a CA bundle to use.
|
||||
Defaults to ``False``.
|
||||
...
|
||||
}
|
||||
:param upgrade_type: flag to check upgrade with bios or irmc
|
||||
|
@ -911,7 +912,7 @@ def get_firmware_upgrade_status(irmc_info, upgrade_type):
|
|||
port = irmc_info.get('irmc_port', 443)
|
||||
auth_method = irmc_info.get('irmc_auth_method', 'digest')
|
||||
client_timeout = irmc_info.get('irmc_client_timeout', 60)
|
||||
verify = irmc_info.get('irmc_verify_ca', True)
|
||||
verify = irmc_info.get('irmc_verify_ca', False)
|
||||
|
||||
auth_obj = None
|
||||
try:
|
||||
|
|
|
@ -223,7 +223,7 @@ class SCCITestCase(testtools.TestCase):
|
|||
'https://' + self.irmc_address + '/config',
|
||||
data=scci.POWER_ON,
|
||||
headers={'Content-type': 'application/x-www-form-urlencoded'},
|
||||
verify=True,
|
||||
verify=False,
|
||||
timeout=self.irmc_client_timeout,
|
||||
allow_redirects=False,
|
||||
auth=mock_requests.auth.HTTPBasicAuth(self.irmc_username,
|
||||
|
|
Loading…
Reference in New Issue