From 3371e2b0ed1fc6c5c38f6e99cfa3f30132bc6fcd Mon Sep 17 00:00:00 2001 From: Ryan Zimmerman Date: Wed, 17 Feb 2021 23:21:14 -0800 Subject: [PATCH] Add compute microversion 2.70 Compute 2.70 [1] added the tag parameter to the server interface and volume attachment response bodies. [1] https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id64 Change-Id: Ibde8e269db82d610d142b7785f1b1d8b91f495b0 --- openstack/compute/v2/server_interface.py | 4 ++++ openstack/compute/v2/volume_attachment.py | 4 ++++ openstack/tests/unit/compute/v2/test_server_interface.py | 2 ++ openstack/tests/unit/compute/v2/test_volume_attachment.py | 2 ++ 4 files changed, 12 insertions(+) diff --git a/openstack/compute/v2/server_interface.py b/openstack/compute/v2/server_interface.py index f12213c54..52d3bffa8 100644 --- a/openstack/compute/v2/server_interface.py +++ b/openstack/compute/v2/server_interface.py @@ -37,3 +37,7 @@ class ServerInterface(resource.Resource): port_state = resource.Body('port_state') #: The ID for the server. server_id = resource.URI('server_id') + #: Tags for the virtual interfaces. + tag = resource.Body('tag') + # tag introduced in 2.70 + _max_microversion = '2.70' diff --git a/openstack/compute/v2/volume_attachment.py b/openstack/compute/v2/volume_attachment.py index 750a62a58..770395c7d 100644 --- a/openstack/compute/v2/volume_attachment.py +++ b/openstack/compute/v2/volume_attachment.py @@ -37,3 +37,7 @@ class VolumeAttachment(resource.Resource): volume_id = resource.Body('volumeId') #: The ID of the attachment you want to delete or update. attachment_id = resource.Body('attachment_id', alternate_id=True) + #: Virtual device tags for the attachment. + tag = resource.Body('tag') + # tag introduced in 2.70 + _max_microversion = '2.70' diff --git a/openstack/tests/unit/compute/v2/test_server_interface.py b/openstack/tests/unit/compute/v2/test_server_interface.py index 9b4fa7f2b..5c3ef7e68 100644 --- a/openstack/tests/unit/compute/v2/test_server_interface.py +++ b/openstack/tests/unit/compute/v2/test_server_interface.py @@ -27,6 +27,7 @@ EXAMPLE = { 'port_id': '4', 'port_state': '5', 'server_id': '6', + 'tag': '7', } @@ -51,3 +52,4 @@ class TestServerInterface(base.TestCase): self.assertEqual(EXAMPLE['port_id'], sot.port_id) self.assertEqual(EXAMPLE['port_state'], sot.port_state) self.assertEqual(EXAMPLE['server_id'], sot.server_id) + self.assertEqual(EXAMPLE['tag'], sot.tag) diff --git a/openstack/tests/unit/compute/v2/test_volume_attachment.py b/openstack/tests/unit/compute/v2/test_volume_attachment.py index 66068dce9..7a7a55c7d 100644 --- a/openstack/tests/unit/compute/v2/test_volume_attachment.py +++ b/openstack/tests/unit/compute/v2/test_volume_attachment.py @@ -18,6 +18,7 @@ EXAMPLE = { 'device': '1', 'id': '2', 'volume_id': '3', + 'tag': '4', } @@ -44,3 +45,4 @@ class TestServerInterface(base.TestCase): self.assertEqual(EXAMPLE['device'], sot.device) self.assertEqual(EXAMPLE['id'], sot.id) self.assertEqual(EXAMPLE['volume_id'], sot.volume_id) + self.assertEqual(EXAMPLE['tag'], sot.tag)