From 51ee17a94dccd297101725593b223f01c4f9b906 Mon Sep 17 00:00:00 2001 From: Lee Yarwood Date: Thu, 12 Aug 2021 11:27:17 +0100 Subject: compute: Add support for microversion 2.89 This microversion drops the duplicate ``id`` field while adding ``attachment_id`` and ``bdm_uuid`` to the output of the os-volume_attachments API reflected within osc by the ``openstack server volume list $server``command. Depends-On: https://review.opendev.org/c/openstack/nova/+/804275 Change-Id: I8a7002d8d65d7795e106b768df868198ab8b8143 --- openstackclient/compute/v2/server_volume.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'openstackclient/compute') diff --git a/openstackclient/compute/v2/server_volume.py b/openstackclient/compute/v2/server_volume.py index b53c92fe..d53cec93 100644 --- a/openstackclient/compute/v2/server_volume.py +++ b/openstackclient/compute/v2/server_volume.py @@ -44,18 +44,24 @@ class ListServerVolume(command.Lister): volumes = compute_client.volumes.get_server_volumes(server.id) - columns = ( - 'id', + columns = () + column_headers = () + + if compute_client.api_version < api_versions.APIVersion('2.89'): + columns += ('id',) + column_headers += ('ID',) + + columns += ( 'device', 'serverId', 'volumeId', ) - column_headers = ( - 'ID', + column_headers += ( 'Device', 'Server ID', 'Volume ID', ) + if compute_client.api_version >= api_versions.APIVersion('2.70'): columns += ('tag',) column_headers += ('Tag',) @@ -64,6 +70,10 @@ class ListServerVolume(command.Lister): columns += ('delete_on_termination',) column_headers += ('Delete On Termination?',) + if compute_client.api_version >= api_versions.APIVersion('2.89'): + columns += ('attachment_id', 'bdm_uuid') + column_headers += ('Attachment ID', 'BlockDeviceMapping UUID') + return ( column_headers, ( -- cgit v1.2.1