From 342fd158e9a0744ff75e9234c996b6b5ef1907ff Mon Sep 17 00:00:00 2001 From: xiexs Date: Mon, 23 Nov 2015 08:19:00 -0500 Subject: Add status column for "openstack image list" Actually, the status column is useful for the user. So, it`s better to output this info by default (or, user had to specify the extra option, i.e. --long). Change-Id: Id2a9f86f0de5310f8f5ff9a46bf1b7411094b519 Closes-Bug: #1519181 --- openstackclient/image/v1/image.py | 9 +++++++-- openstackclient/image/v2/image.py | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'openstackclient/image') diff --git a/openstackclient/image/v1/image.py b/openstackclient/image/v1/image.py index 35e9ef43..4ebc8f93 100644 --- a/openstackclient/image/v1/image.py +++ b/openstackclient/image/v1/image.py @@ -354,7 +354,12 @@ class ListImage(lister.Lister): kwargs['public'] = True if parsed_args.private: kwargs['private'] = True - kwargs['detailed'] = bool(parsed_args.property or parsed_args.long) + # Note: We specifically need to do that below to get the 'status' + # column. + # + # Always set kwargs['detailed'] to True, and then filter the columns + # according to whether the --long option is specified or not. + kwargs['detailed'] = True if parsed_args.long: columns = ( @@ -382,7 +387,7 @@ class ListImage(lister.Lister): 'Properties', ) else: - columns = ("ID", "Name") + columns = ("ID", "Name", "Status") column_headers = columns # List of image data received diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py index 5552f033..c0fb5b58 100644 --- a/openstackclient/image/v2/image.py +++ b/openstackclient/image/v2/image.py @@ -417,7 +417,7 @@ class ListImage(lister.Lister): 'Tags', ) else: - columns = ("ID", "Name") + columns = ("ID", "Name", "Status") column_headers = columns # List of image data received -- cgit v1.2.1