2 parents 59ffee2 + 15edb2f commit a48de85Copy full SHA for a48de85
1 file changed
openstackclient/identity/v3/token.py
@@ -18,6 +18,7 @@
18
import six
19
20
from openstackclient.common import command
21
+from openstackclient.common import exceptions
22
from openstackclient.common import utils
23
from openstackclient.identity import common
24
@@ -172,6 +173,9 @@ def get_parser(self, prog_name):
172
173
return parser
174
175
def take_action(self, parsed_args):
176
+ if not self.app.client_manager.auth_ref:
177
+ raise exceptions.AuthorizationFailure(
178
+ "Only an authorized user may issue a new token.")
179
token = self.app.client_manager.auth_ref.service_catalog.get_token()
180
if 'tenant_id' in token:
181
token['project_id'] = token.pop('tenant_id')
0 commit comments