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
changes/66/488966/1 1.3.0
Richard Pioso 6 years ago
parent 38d863e489
commit bcfe996deb

@ -626,8 +626,7 @@ class WSManClient(wsman.Client):
:raises: WSManInvalidResponse when receiving invalid response
"""
if wait_for_idrac:
self.wait_until_idrac_is_ready(self._ready_retries,
self._ready_retry_delay)
self.wait_until_idrac_is_ready()
return super(WSManClient, self).enumerate(resource_uri, optimization,
max_elems, auto_pull,
@ -656,8 +655,7 @@ class WSManClient(wsman.Client):
:raises: DRACUnexpectedReturnValue on return value mismatch
"""
if wait_for_idrac:
self.wait_until_idrac_is_ready(self._ready_retries,
self._ready_retry_delay)
self.wait_until_idrac_is_ready()
if selectors is None:
selectors = {}

@ -34,9 +34,7 @@ class WSManClientTestCase(base.BaseTest):
client = dracclient.client.WSManClient(**test_utils.FAKE_ENDPOINT)
resp = client.enumerate('http://resource')
mock_wait_until_idrac_is_ready.assert_called_once_with(
client, constants.DEFAULT_IDRAC_IS_READY_RETRIES,
constants.DEFAULT_IDRAC_IS_READY_RETRY_DELAY_SEC)
mock_wait_until_idrac_is_ready.assert_called_once_with(client)
self.assertEqual('yay!', resp.text)
@mock.patch.object(dracclient.client.WSManClient,
@ -66,9 +64,7 @@ class WSManClientTestCase(base.BaseTest):
client = dracclient.client.WSManClient(**test_utils.FAKE_ENDPOINT)
resp = client.invoke('http://resource', 'Foo')
mock_wait_until_idrac_is_ready.assert_called_once_with(
client, constants.DEFAULT_IDRAC_IS_READY_RETRIES,
constants.DEFAULT_IDRAC_IS_READY_RETRY_DELAY_SEC)
mock_wait_until_idrac_is_ready.assert_called_once_with(client)
self.assertEqual('yay!', resp.find('result').text)
@mock.patch.object(dracclient.client.WSManClient,

Loading…
Cancel
Save