summaryrefslogtreecommitdiff
path: root/openstackclient/identity
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-02-21 04:31:50 +0000
committerGerrit Code Review <review@openstack.org>2016-02-21 04:31:51 +0000
commit867bcb0db8742fd2daa5c91dfd3c164ac4178f18 (patch)
treeab6312faf2d924879996e74bdfd5492b4f459598 /openstackclient/identity
parentf4ca06cad6348b2a00d72d65c7a1c2f56e8df1d4 (diff)
parent41e1bd0be64e15a5e0c12b45bdf3dcde5fabf244 (diff)
downloadpython-openstackclient-867bcb0db8742fd2daa5c91dfd3c164ac4178f18.tar.gz
Merge "Support unscoped token request"
Diffstat (limited to 'openstackclient/identity')
-rw-r--r--openstackclient/identity/v2_0/token.py6
-rw-r--r--openstackclient/identity/v3/token.py3
2 files changed, 8 insertions, 1 deletions
diff --git a/openstackclient/identity/v2_0/token.py b/openstackclient/identity/v2_0/token.py
index db38fae8..6a66a1c6 100644
--- a/openstackclient/identity/v2_0/token.py
+++ b/openstackclient/identity/v2_0/token.py
@@ -24,6 +24,9 @@ from openstackclient.i18n import _ # noqa
class IssueToken(command.ShowOne):
"""Issue new token"""
+ # scoped token is optional
+ required_scope = False
+
def get_parser(self, prog_name):
parser = super(IssueToken, self).get_parser(prog_name)
return parser
@@ -31,7 +34,8 @@ class IssueToken(command.ShowOne):
def take_action(self, parsed_args):
token = self.app.client_manager.auth_ref.service_catalog.get_token()
- token['project_id'] = token.pop('tenant_id')
+ if 'tenant_id' in token:
+ token['project_id'] = token.pop('tenant_id')
return zip(*sorted(six.iteritems(token)))
diff --git a/openstackclient/identity/v3/token.py b/openstackclient/identity/v3/token.py
index 9ebd1799..5f131939 100644
--- a/openstackclient/identity/v3/token.py
+++ b/openstackclient/identity/v3/token.py
@@ -164,6 +164,9 @@ class CreateRequestToken(command.ShowOne):
class IssueToken(command.ShowOne):
"""Issue new token"""
+ # scoped token is optional
+ required_scope = False
+
def get_parser(self, prog_name):
parser = super(IssueToken, self).get_parser(prog_name)
return parser