summaryrefslogtreecommitdiff
path: root/openstackclient/common
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/common')
-rw-r--r--openstackclient/common/clientmanager.py4
-rw-r--r--openstackclient/common/limits.py2
-rw-r--r--openstackclient/common/quota.py8
3 files changed, 9 insertions, 5 deletions
diff --git a/openstackclient/common/clientmanager.py b/openstackclient/common/clientmanager.py
index d8e7e1a9..55c6fe53 100644
--- a/openstackclient/common/clientmanager.py
+++ b/openstackclient/common/clientmanager.py
@@ -49,6 +49,10 @@ class ClientCache(object):
class ClientManager(object):
"""Manages access to API clients, including authentication."""
+
+ # A simple incrementing version for the plugin to know what is available
+ PLUGIN_INTERFACE_VERSION = "2"
+
identity = ClientCache(identity_client.make_client)
def __getattr__(self, name):
diff --git a/openstackclient/common/limits.py b/openstackclient/common/limits.py
index 4abcf169..c738f150 100644
--- a/openstackclient/common/limits.py
+++ b/openstackclient/common/limits.py
@@ -31,7 +31,7 @@ class ShowLimits(lister.Lister):
def get_parser(self, prog_name):
parser = super(ShowLimits, self).get_parser(prog_name)
- type_group = parser.add_mutually_exclusive_group()
+ type_group = parser.add_mutually_exclusive_group(required=True)
type_group.add_argument(
"--absolute",
dest="is_absolute",
diff --git a/openstackclient/common/quota.py b/openstackclient/common/quota.py
index a40f6e4d..e79fd7ed 100644
--- a/openstackclient/common/quota.py
+++ b/openstackclient/common/quota.py
@@ -97,12 +97,13 @@ class SetQuota(command.Command):
compute_kwargs = {}
for k, v in COMPUTE_QUOTAS.items():
- value = getattr(parsed_args, v, None)
+ value = getattr(parsed_args, k, None)
if value is not None:
compute_kwargs[k] = value
volume_kwargs = {}
for k, v in VOLUME_QUOTAS.items():
+ # TODO(jiaxi): Should use k or v needs discuss
value = getattr(parsed_args, v, None)
if value is not None:
if parsed_args.volume_type:
@@ -222,8 +223,7 @@ class ShowQuota(show.ShowOne):
info.pop(k)
# Handle project ID special as it only appears in output
- if info['id']:
- info['project'] = info['id']
- info.pop('id')
+ if 'id' in info:
+ info['project'] = info.pop('id')
return zip(*sorted(six.iteritems(info)))