diff options
| author | Ritvik Vinodkumar <vinodkumar.r@northeastern.edu> | 2021-11-18 16:27:16 +0000 |
|---|---|---|
| committer | Stephen Finucane <sfinucan@redhat.com> | 2022-01-14 18:36:37 +0000 |
| commit | b5a2714b83d4ce1991aae775381dcfb02ff59e9d (patch) | |
| tree | fe87a007d53e6dff6e4c1b162c42add983ac70ee /openstackclient/tests/unit/compute/v2/fakes.py | |
| parent | 0a887a4786eef67bb88d191c66217f82cf7b8127 (diff) | |
| download | python-openstackclient-b5a2714b83d4ce1991aae775381dcfb02ff59e9d.tar.gz | |
Switch compute service list, delete and set to sdk.
Switch the compute service commands from novaclient to SDK.
Change-Id: I16498905101d6c2702a3ccbaf8cf5e3098d51992
Diffstat (limited to 'openstackclient/tests/unit/compute/v2/fakes.py')
| -rw-r--r-- | openstackclient/tests/unit/compute/v2/fakes.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/openstackclient/tests/unit/compute/v2/fakes.py b/openstackclient/tests/unit/compute/v2/fakes.py index 2a531647..55572cd8 100644 --- a/openstackclient/tests/unit/compute/v2/fakes.py +++ b/openstackclient/tests/unit/compute/v2/fakes.py @@ -22,6 +22,7 @@ from novaclient import api_versions from openstack.compute.v2 import flavor as _flavor from openstack.compute.v2 import server from openstack.compute.v2 import server_interface as _server_interface +from openstack.compute.v2 import service from openstack.compute.v2 import volume_attachment from openstackclient.api import compute_v2 @@ -764,7 +765,7 @@ class FakeService(object): :param dict attrs: A dictionary with all attributes :return: - A FakeResource object, with id, host, binary, and so on + A fake Service object, with id, host, binary, and so on """ attrs = attrs or {} @@ -774,21 +775,18 @@ class FakeService(object): 'host': 'host-' + uuid.uuid4().hex, 'binary': 'binary-' + uuid.uuid4().hex, 'status': 'enabled', - 'zone': 'zone-' + uuid.uuid4().hex, + 'availability_zone': 'zone-' + uuid.uuid4().hex, 'state': 'state-' + uuid.uuid4().hex, 'updated_at': 'time-' + uuid.uuid4().hex, 'disabled_reason': 'earthquake', # Introduced in API microversion 2.11 - 'forced_down': False, + 'is_forced_down': False, } # Overwrite default attributes. service_info.update(attrs) - service = fakes.FakeResource(info=copy.deepcopy(service_info), - loaded=True) - - return service + return service.Service(**service_info) @staticmethod def create_services(attrs=None, count=2): |
