diff --git a/senlin/drivers/os/nova_v2.py b/senlin/drivers/os/nova_v2.py index 1dc842362..8d0044cc9 100644 --- a/senlin/drivers/os/nova_v2.py +++ b/senlin/drivers/os/nova_v2.py @@ -72,8 +72,11 @@ class NovaClient(base.DriverBase): @sdk.translate_exception def server_rebuild(self, server, image, name=None, admin_password=None, **attrs): - return self.conn.compute.rebuild_server(server, name, admin_password, - image=image, **attrs) + attrs.update({ + "name": name, + "admin_password": admin_password + }) + return self.conn.compute.rebuild_server(server, image=image, **attrs) @sdk.translate_exception def server_resize(self, server, flavor): diff --git a/senlin/tests/unit/drivers/test_nova_v2.py b/senlin/tests/unit/drivers/test_nova_v2.py index d150802b9..1919be371 100644 --- a/senlin/tests/unit/drivers/test_nova_v2.py +++ b/senlin/tests/unit/drivers/test_nova_v2.py @@ -120,8 +120,12 @@ class TestNovaV2(base.SenlinTestCase): 'metadata': {'k1': 'v1'} } d.server_rebuild('sid', 'new_image', 'new_name', 'new_pass', **attrs) + attrs.update({ + "name": 'new_name', + "admin_password": 'new_pass' + }) self.compute.rebuild_server.assert_called_once_with( - 'sid', 'new_name', 'new_pass', image='new_image', **attrs) + 'sid', image='new_image', **attrs) def test_server_resize(self): d = nova_v2.NovaClient(self.conn_params)