Merge "compute: Switch server restore to SDK"
This commit is contained in:
@@ -4044,12 +4044,13 @@ class RestoreServer(command.Command):
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
compute_client = self.app.client_manager.compute
|
||||
compute_client = self.app.client_manager.sdk_connection.compute
|
||||
for server in parsed_args.server:
|
||||
utils.find_resource(
|
||||
compute_client.servers,
|
||||
server
|
||||
).restore()
|
||||
server_id = compute_client.find_server(
|
||||
server,
|
||||
ignore_missing=False,
|
||||
).id
|
||||
compute_client.restore_server(server_id)
|
||||
|
||||
|
||||
class ResumeServer(command.Command):
|
||||
|
@@ -7498,21 +7498,16 @@ class TestServerRevertMigration(TestServer):
|
||||
class TestServerRestore(TestServer):
|
||||
|
||||
def setUp(self):
|
||||
super(TestServerRestore, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
# Get the command object to test
|
||||
self.cmd = server.RestoreServer(self.app, None)
|
||||
|
||||
# Set methods to be tested.
|
||||
self.methods = {
|
||||
'restore': None,
|
||||
}
|
||||
|
||||
def test_server_restore_one_server(self):
|
||||
self.run_method_with_servers('restore', 1)
|
||||
self.run_method_with_sdk_servers('restore_server', 1)
|
||||
|
||||
def test_server_restore_multi_servers(self):
|
||||
self.run_method_with_servers('restore', 3)
|
||||
self.run_method_with_sdk_servers('restore_server', 3)
|
||||
|
||||
|
||||
class TestServerResume(TestServer):
|
||||
|
@@ -0,0 +1,4 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The ``server restore`` command has been migrated to SDK.
|
Reference in New Issue
Block a user