From 2be7e0f6f791feda8a53c73e23d0cf04e9daa478 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sat, 2 Feb 2019 15:26:51 +0000 Subject: [PATCH] Rename compute.service.zone to availability_zone While zone is less characters, availability_zone is what this is called across the rest of the codebase, and is what the location system looks for. This is an incompatibility to be taken care of pre-1.0 release. Change-Id: I9fc7ac2a32ac20f173554dcde80eb57713a92f7c --- openstack/compute/v2/service.py | 2 +- openstack/tests/unit/compute/v2/test_service.py | 2 +- .../notes/compute-service-zone-2b25ec705b0156c4.yaml | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/compute-service-zone-2b25ec705b0156c4.yaml diff --git a/openstack/compute/v2/service.py b/openstack/compute/v2/service.py index f13cac1c4..d1361ffd8 100644 --- a/openstack/compute/v2/service.py +++ b/openstack/compute/v2/service.py @@ -37,7 +37,7 @@ class Service(resource.Resource): #: Host where service runs host = resource.Body('host') #: The availability zone of service - zone = resource.Body("zone") + availability_zone = resource.Body("zone") def _action(self, session, action, body): url = utils.urljoin(Service.base_path, action) diff --git a/openstack/tests/unit/compute/v2/test_service.py b/openstack/tests/unit/compute/v2/test_service.py index 159423505..5b72b6f52 100644 --- a/openstack/tests/unit/compute/v2/test_service.py +++ b/openstack/tests/unit/compute/v2/test_service.py @@ -51,7 +51,7 @@ class TestService(base.TestCase): self.assertEqual(EXAMPLE['binary'], sot.binary) self.assertEqual(EXAMPLE['status'], sot.status) self.assertEqual(EXAMPLE['state'], sot.state) - self.assertEqual(EXAMPLE['zone'], sot.zone) + self.assertEqual(EXAMPLE['zone'], sot.availability_zone) self.assertEqual(EXAMPLE['id'], sot.id) def test_force_down(self): diff --git a/releasenotes/notes/compute-service-zone-2b25ec705b0156c4.yaml b/releasenotes/notes/compute-service-zone-2b25ec705b0156c4.yaml new file mode 100644 index 000000000..ea69aef6a --- /dev/null +++ b/releasenotes/notes/compute-service-zone-2b25ec705b0156c4.yaml @@ -0,0 +1,7 @@ +--- +upgrade: + - | + The ``zone`` attribute on compute ``Service`` objects + has been renamed to ``availability_zone`` to match all + of the other resources, and also to better integrate + with the ``Resource.location`` attribute.