compute: host: expand kwargs in host_set() call
`host_set()` expects `status` and `maintenance_mode` as keyword arguments, but in `SetHost.take_action()`, it is called without expanding the keyword arguments. So it's called as ``` host_set(host, {'status': 'enable'}) ``` instead of ``` host_set(host, status='enable') ``` Change-Id: If0b37ac60091161a892bfc694fce31a988f66005 Task: 23023
This commit is contained in:
parent
ee35409069
commit
fc76db0def
@ -97,7 +97,7 @@ class SetHost(command.Command):
|
|||||||
|
|
||||||
compute_client.api.host_set(
|
compute_client.api.host_set(
|
||||||
parsed_args.host,
|
parsed_args.host,
|
||||||
kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -111,8 +111,7 @@ class TestHostSet(TestHost):
|
|||||||
result = self.cmd.take_action(parsed_args)
|
result = self.cmd.take_action(parsed_args)
|
||||||
self.assertIsNone(result)
|
self.assertIsNone(result)
|
||||||
|
|
||||||
body = {}
|
h_mock.assert_called_with(self.host['host'])
|
||||||
h_mock.assert_called_with(self.host['host'], body)
|
|
||||||
|
|
||||||
def test_host_set(self, h_mock):
|
def test_host_set(self, h_mock):
|
||||||
h_mock.return_value = self.host
|
h_mock.return_value = self.host
|
||||||
@ -133,8 +132,8 @@ class TestHostSet(TestHost):
|
|||||||
result = self.cmd.take_action(parsed_args)
|
result = self.cmd.take_action(parsed_args)
|
||||||
self.assertIsNone(result)
|
self.assertIsNone(result)
|
||||||
|
|
||||||
body = {'status': 'enable', 'maintenance_mode': 'disable'}
|
h_mock.assert_called_with(self.host['host'], status='enable',
|
||||||
h_mock.assert_called_with(self.host['host'], body)
|
maintenance_mode='disable')
|
||||||
|
|
||||||
|
|
||||||
@mock.patch(
|
@mock.patch(
|
||||||
|
Loading…
Reference in New Issue
Block a user