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:
@@ -191,7 +191,7 @@ def elcm_request(irmc_info, method, path, **kwargs):
|
|||||||
'irmc_verify_ca': Either a boolean, in which case it controls
|
'irmc_verify_ca': Either a boolean, in which case it controls
|
||||||
whether we verify the server's TLS certificate,
|
whether we verify the server's TLS certificate,
|
||||||
or a string, in which case it must be a path to
|
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'
|
: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']
|
userid = irmc_info['irmc_username']
|
||||||
password = irmc_info['irmc_password']
|
password = irmc_info['irmc_password']
|
||||||
client_timeout = irmc_info.get('irmc_client_timeout', 60)
|
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
|
# Request headers, params, and data
|
||||||
headers = kwargs.get('headers', {'Accept': 'application/json'})
|
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',
|
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
|
"""execute SCCI command
|
||||||
|
|
||||||
This function calls SCCI server modules
|
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
|
:param verify: (optional) Either a boolean, in which case it
|
||||||
controls whether we verify the server's TLS certificate,
|
controls whether we verify the server's TLS certificate,
|
||||||
or a string, in which case it must be a path to
|
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
|
:returns: requests.Response from SCCI server
|
||||||
:raises: SCCIInvalidInputError if port and/or auth_method params
|
:raises: SCCIInvalidInputError if port and/or auth_method params
|
||||||
are invalid
|
are invalid
|
||||||
@@ -496,7 +496,7 @@ def check_eject_fd_cmd(xml_cmd):
|
|||||||
|
|
||||||
|
|
||||||
def get_client(host, userid, password, port=443, auth_method='basic',
|
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
|
"""get SCCI command partial function
|
||||||
|
|
||||||
This function returns 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
|
:param verify: (optional) Either a boolean, in which case it
|
||||||
controls whether we verify the server's TLS certificate,
|
controls whether we verify the server's TLS certificate,
|
||||||
or a string, in which case it must be a path to
|
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
|
: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,
|
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
|
"""get iRMC report
|
||||||
|
|
||||||
This function returns iRMC report in XML format
|
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
|
:param verify: (optional) Either a boolean, in which case it
|
||||||
controls whether we verify the server's TLS certificate,
|
controls whether we verify the server's TLS certificate,
|
||||||
or a string, in which case it must be a path to
|
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
|
:returns: root element of SCCI report
|
||||||
:raises: ISCCIInvalidInputError if port and/or auth_method params
|
:raises: ISCCIInvalidInputError if port and/or auth_method params
|
||||||
are invalid
|
are invalid
|
||||||
@@ -895,8 +895,9 @@ def get_firmware_upgrade_status(irmc_info, upgrade_type):
|
|||||||
'irmc_client_timeout': timeout, default is 60,
|
'irmc_client_timeout': timeout, default is 60,
|
||||||
'irmc_verify_ca': (optional) Either a boolean, in which case it
|
'irmc_verify_ca': (optional) Either a boolean, in which case it
|
||||||
controls whether we verify the server's TLS
|
controls whether we verify the server's TLS
|
||||||
certificate, or a string, in which case it must be
|
certificate, or a string, in which case it
|
||||||
a path to a CA bundle to use. Defaults to ``True``.
|
must be a path to a CA bundle to use.
|
||||||
|
Defaults to ``False``.
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
:param upgrade_type: flag to check upgrade with bios or irmc
|
: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)
|
port = irmc_info.get('irmc_port', 443)
|
||||||
auth_method = irmc_info.get('irmc_auth_method', 'digest')
|
auth_method = irmc_info.get('irmc_auth_method', 'digest')
|
||||||
client_timeout = irmc_info.get('irmc_client_timeout', 60)
|
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
|
auth_obj = None
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ class SCCITestCase(testtools.TestCase):
|
|||||||
'https://' + self.irmc_address + '/config',
|
'https://' + self.irmc_address + '/config',
|
||||||
data=scci.POWER_ON,
|
data=scci.POWER_ON,
|
||||||
headers={'Content-type': 'application/x-www-form-urlencoded'},
|
headers={'Content-type': 'application/x-www-form-urlencoded'},
|
||||||
verify=True,
|
verify=False,
|
||||||
timeout=self.irmc_client_timeout,
|
timeout=self.irmc_client_timeout,
|
||||||
allow_redirects=False,
|
allow_redirects=False,
|
||||||
auth=mock_requests.auth.HTTPBasicAuth(self.irmc_username,
|
auth=mock_requests.auth.HTTPBasicAuth(self.irmc_username,
|
||||||
|
|||||||
Reference in New Issue
Block a user