Merge "Fix error can't do rebuild nova instances"
This commit is contained in:
commit
02e4acdc6c
@ -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):
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user