From 2689984ba71fa0be25d2368277f33f2fb5c41266 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Mon, 17 Jul 2017 16:03:49 -0500 Subject: Fix column names for server list --no-name-lookup When --long is not present change the 'Image Name' column to 'Image' and add the 'Flavor' column. These columns will contain Names unless --no-name-lookup is specified when they will contain IDs. Change-Id: I92cfb22136aee32616894e60e9227b4da185da99 --- openstackclient/compute/v2/server.py | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'openstackclient/compute') diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py index cb520d62..a991ed45 100644 --- a/openstackclient/compute/v2/server.py +++ b/openstackclient/compute/v2/server.py @@ -1060,26 +1060,33 @@ class ListServer(command.Lister): 'OS-EXT-AZ:availability_zone', 'OS-EXT-SRV-ATTR:host', ] - elif parsed_args.no_name_lookup: - columns = ( - 'ID', - 'Name', - 'Status', - 'Image ID', - 'Flavor ID', - ) - column_headers = tuple(columns) - mixed_case_fields = [] - else: - columns = ( + if parsed_args.no_name_lookup: + columns = ( + 'ID', + 'Name', + 'Status', + 'Networks', + 'Image ID', + 'Flavor ID', + ) + else: + columns = ( + 'ID', + 'Name', + 'Status', + 'Networks', + 'Image Name', + 'Flavor Name', + ) + column_headers = ( 'ID', 'Name', 'Status', 'Networks', - 'Image Name', + 'Image', + 'Flavor', ) - column_headers = tuple(columns) mixed_case_fields = [] marker_id = None -- cgit v1.2.1