summaryrefslogtreecommitdiff
path: root/openstackclient/image
diff options
context:
space:
mode:
authorxiexs <xiexs@cn.fujitsu.com>2015-11-23 08:19:00 -0500
committerxiexs <xiexs@cn.fujitsu.com>2015-11-29 20:37:40 -0500
commit342fd158e9a0744ff75e9234c996b6b5ef1907ff (patch)
tree6f89f2db40c406c3b32e6975d4a5202c7fecd7ca /openstackclient/image
parent27869c0f3ffca5bd15700a198dd9e5929ea4d77d (diff)
downloadpython-openstackclient-342fd158e9a0744ff75e9234c996b6b5ef1907ff.tar.gz
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
Diffstat (limited to 'openstackclient/image')
-rw-r--r--openstackclient/image/v1/image.py9
-rw-r--r--openstackclient/image/v2/image.py2
2 files changed, 8 insertions, 3 deletions
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