summaryrefslogtreecommitdiff
path: root/openstackclient/common
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-07-09 06:59:39 +0000
committerGerrit Code Review <review@openstack.org>2014-07-09 06:59:39 +0000
commite8f058775eb3dbb9a159218c427d439b3dcc6012 (patch)
treef8c32a714ec66f8a8a3a28c9d368c7d99dee59b5 /openstackclient/common
parente7bfabc886f9b132de2d2705f40b746cf052c7dd (diff)
parent9b2e264ada9f98444d5c7f106dd320dde282946c (diff)
downloadpython-openstackclient-e8f058775eb3dbb9a159218c427d439b3dcc6012.tar.gz
Merge "Add support to list volume extensions"
Diffstat (limited to 'openstackclient/common')
-rw-r--r--openstackclient/common/extension.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/openstackclient/common/extension.py b/openstackclient/common/extension.py
index a3f94c09..91ee228b 100644
--- a/openstackclient/common/extension.py
+++ b/openstackclient/common/extension.py
@@ -47,6 +47,11 @@ class ListExtension(lister.Lister):
action='store_true',
default=False,
help='List extensions for the Compute API')
+ parser.add_argument(
+ '--volume',
+ action='store_true',
+ default=False,
+ help='List extensions for the Volume API')
return parser
def take_action(self, parsed_args):
@@ -63,7 +68,8 @@ class ListExtension(lister.Lister):
# by default we want to show everything, unless the
# user specifies one or more of the APIs to show
# for now, only identity and compute are supported.
- show_all = (not parsed_args.identity and not parsed_args.compute)
+ show_all = (not parsed_args.identity and not parsed_args.compute
+ and not parsed_args.volume)
if parsed_args.identity or show_all:
identity_client = self.app.client_manager.identity
@@ -81,6 +87,14 @@ class ListExtension(lister.Lister):
message = "Extensions list not supported by Compute API"
self.log.warning(message)
+ if parsed_args.volume or show_all:
+ volume_client = self.app.client_manager.volume
+ try:
+ data += volume_client.list_extensions.show_all()
+ except Exception:
+ message = "Extensions list not supported by Volume API"
+ self.log.warning(message)
+
return (columns,
(utils.get_item_properties(
s, columns,