Switch server suspend and server resume to SDK
Switch the server suspend and server resume commands from novaclient to SDK. Use the SDK versions of test fakes to support fake Server resources. Change-Id: Idd0b4f13fab0f238e42844a7d759538bbda24f68
This commit is contained in:
parent
b515fe61b2
commit
ff96fea012
@ -4081,13 +4081,13 @@ class ResumeServer(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_id = compute_client.find_server(
|
||||
server,
|
||||
).resume()
|
||||
ignore_missing=False,
|
||||
).id
|
||||
compute_client.resume_server(server_id)
|
||||
|
||||
|
||||
class SetServer(command.Command):
|
||||
@ -4652,13 +4652,13 @@ class SuspendServer(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_id = compute_client.find_server(
|
||||
server,
|
||||
).suspend()
|
||||
ignore_missing=False,
|
||||
).id
|
||||
compute_client.suspend_server(server_id)
|
||||
|
||||
|
||||
class UnlockServer(command.Command):
|
||||
|
@ -7617,10 +7617,10 @@ class TestServerResume(TestServer):
|
||||
}
|
||||
|
||||
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):
|
||||
self.run_method_with_servers('resume', 3)
|
||||
self.run_method_with_sdk_servers('resume_server', 3)
|
||||
|
||||
|
||||
class TestServerSet(TestServer):
|
||||
@ -8284,10 +8284,10 @@ class TestServerSuspend(TestServer):
|
||||
}
|
||||
|
||||
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):
|
||||
self.run_method_with_servers('suspend', 3)
|
||||
self.run_method_with_sdk_servers('suspend_server', 3)
|
||||
|
||||
|
||||
class TestServerUnlock(TestServer):
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Migrate ``server suspend`` and ``server resume`` commands from novaclient
|
||||
to sdk.
|
Loading…
x
Reference in New Issue
Block a user