Simplify wait_until_idrac_is_ready() calls
This change simplifies the internal calls to dracclient.client.WSManClient.wait_until_idrac_is_ready() by no longer passing arguments. That makes the code cleaner and easier to understand. It contains no functional change. The arguments no longer need to be passed, because that function's default parameter values are now None, which means use the values that were provided when the WSManClient object was created. The default values provided at creation are equal to the arguments that were being explicitly passed. Change-Id: I70237bb9eda49a98c55a452b7f534a1e720696bb Related-Bug: #1697558
This commit is contained in:
parent
38d863e489
commit
bcfe996deb
|
@ -626,8 +626,7 @@ class WSManClient(wsman.Client):
|
||||||
:raises: WSManInvalidResponse when receiving invalid response
|
:raises: WSManInvalidResponse when receiving invalid response
|
||||||
"""
|
"""
|
||||||
if wait_for_idrac:
|
if wait_for_idrac:
|
||||||
self.wait_until_idrac_is_ready(self._ready_retries,
|
self.wait_until_idrac_is_ready()
|
||||||
self._ready_retry_delay)
|
|
||||||
|
|
||||||
return super(WSManClient, self).enumerate(resource_uri, optimization,
|
return super(WSManClient, self).enumerate(resource_uri, optimization,
|
||||||
max_elems, auto_pull,
|
max_elems, auto_pull,
|
||||||
|
@ -656,8 +655,7 @@ class WSManClient(wsman.Client):
|
||||||
:raises: DRACUnexpectedReturnValue on return value mismatch
|
:raises: DRACUnexpectedReturnValue on return value mismatch
|
||||||
"""
|
"""
|
||||||
if wait_for_idrac:
|
if wait_for_idrac:
|
||||||
self.wait_until_idrac_is_ready(self._ready_retries,
|
self.wait_until_idrac_is_ready()
|
||||||
self._ready_retry_delay)
|
|
||||||
|
|
||||||
if selectors is None:
|
if selectors is None:
|
||||||
selectors = {}
|
selectors = {}
|
||||||
|
|
|
@ -34,9 +34,7 @@ class WSManClientTestCase(base.BaseTest):
|
||||||
|
|
||||||
client = dracclient.client.WSManClient(**test_utils.FAKE_ENDPOINT)
|
client = dracclient.client.WSManClient(**test_utils.FAKE_ENDPOINT)
|
||||||
resp = client.enumerate('http://resource')
|
resp = client.enumerate('http://resource')
|
||||||
mock_wait_until_idrac_is_ready.assert_called_once_with(
|
mock_wait_until_idrac_is_ready.assert_called_once_with(client)
|
||||||
client, constants.DEFAULT_IDRAC_IS_READY_RETRIES,
|
|
||||||
constants.DEFAULT_IDRAC_IS_READY_RETRY_DELAY_SEC)
|
|
||||||
self.assertEqual('yay!', resp.text)
|
self.assertEqual('yay!', resp.text)
|
||||||
|
|
||||||
@mock.patch.object(dracclient.client.WSManClient,
|
@mock.patch.object(dracclient.client.WSManClient,
|
||||||
|
@ -66,9 +64,7 @@ class WSManClientTestCase(base.BaseTest):
|
||||||
|
|
||||||
client = dracclient.client.WSManClient(**test_utils.FAKE_ENDPOINT)
|
client = dracclient.client.WSManClient(**test_utils.FAKE_ENDPOINT)
|
||||||
resp = client.invoke('http://resource', 'Foo')
|
resp = client.invoke('http://resource', 'Foo')
|
||||||
mock_wait_until_idrac_is_ready.assert_called_once_with(
|
mock_wait_until_idrac_is_ready.assert_called_once_with(client)
|
||||||
client, constants.DEFAULT_IDRAC_IS_READY_RETRIES,
|
|
||||||
constants.DEFAULT_IDRAC_IS_READY_RETRY_DELAY_SEC)
|
|
||||||
self.assertEqual('yay!', resp.find('result').text)
|
self.assertEqual('yay!', resp.find('result').text)
|
||||||
|
|
||||||
@mock.patch.object(dracclient.client.WSManClient,
|
@mock.patch.object(dracclient.client.WSManClient,
|
||||||
|
|
Loading…
Reference in New Issue