Merge "Switch server suspend and server resume to SDK"
This commit is contained in:
commit
e02fd2ab18
|
@ -4099,13 +4099,13 @@ class ResumeServer(command.Command):
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
|
compute_client = self.app.client_manager.sdk_connection.compute
|
||||||
compute_client = self.app.client_manager.compute
|
|
||||||
for server in parsed_args.server:
|
for server in parsed_args.server:
|
||||||
utils.find_resource(
|
server_id = compute_client.find_server(
|
||||||
compute_client.servers,
|
|
||||||
server,
|
server,
|
||||||
).resume()
|
ignore_missing=False,
|
||||||
|
).id
|
||||||
|
compute_client.resume_server(server_id)
|
||||||
|
|
||||||
|
|
||||||
class SetServer(command.Command):
|
class SetServer(command.Command):
|
||||||
|
@ -4670,13 +4670,13 @@ class SuspendServer(command.Command):
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
|
compute_client = self.app.client_manager.sdk_connection.compute
|
||||||
compute_client = self.app.client_manager.compute
|
|
||||||
for server in parsed_args.server:
|
for server in parsed_args.server:
|
||||||
utils.find_resource(
|
server_id = compute_client.find_server(
|
||||||
compute_client.servers,
|
|
||||||
server,
|
server,
|
||||||
).suspend()
|
ignore_missing=False,
|
||||||
|
).id
|
||||||
|
compute_client.suspend_server(server_id)
|
||||||
|
|
||||||
|
|
||||||
class UnlockServer(command.Command):
|
class UnlockServer(command.Command):
|
||||||
|
|
|
@ -7617,10 +7617,10 @@ class TestServerResume(TestServer):
|
||||||
}
|
}
|
||||||
|
|
||||||
def test_server_resume_one_server(self):
|
def test_server_resume_one_server(self):
|
||||||
self.run_method_with_servers('resume', 1)
|
self.run_method_with_sdk_servers('resume_server', 1)
|
||||||
|
|
||||||
def test_server_resume_multi_servers(self):
|
def test_server_resume_multi_servers(self):
|
||||||
self.run_method_with_servers('resume', 3)
|
self.run_method_with_sdk_servers('resume_server', 3)
|
||||||
|
|
||||||
|
|
||||||
class TestServerSet(TestServer):
|
class TestServerSet(TestServer):
|
||||||
|
@ -8284,10 +8284,10 @@ class TestServerSuspend(TestServer):
|
||||||
}
|
}
|
||||||
|
|
||||||
def test_server_suspend_one_server(self):
|
def test_server_suspend_one_server(self):
|
||||||
self.run_method_with_servers('suspend', 1)
|
self.run_method_with_sdk_servers('suspend_server', 1)
|
||||||
|
|
||||||
def test_server_suspend_multi_servers(self):
|
def test_server_suspend_multi_servers(self):
|
||||||
self.run_method_with_servers('suspend', 3)
|
self.run_method_with_sdk_servers('suspend_server', 3)
|
||||||
|
|
||||||
|
|
||||||
class TestServerUnlock(TestServer):
|
class TestServerUnlock(TestServer):
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Migrate ``server suspend`` and ``server resume`` commands from novaclient
|
||||||
|
to sdk.
|
Loading…
Reference in New Issue