diff options
author | termie <github@anarkystic.com> | 2012-01-23 17:47:48 -0800 |
---|---|---|
committer | termie <github@anarkystic.com> | 2012-01-23 17:47:48 -0800 |
commit | e344821225d0f44461eff9376de8509660ecd4e1 (patch) | |
tree | 5a92c4d225e832d8d0d464e87bac4c51981d639b /bin | |
parent | 9f0bb492128e396dcdb0d0be76bce913718a6611 (diff) | |
download | keystone-e344821225d0f44461eff9376de8509660ecd4e1.tar.gz keystone-e344821225d0f44461eff9376de8509660ecd4e1.tar.xz keystone-e344821225d0f44461eff9376de8509660ecd4e1.zip |
fix token vs auth_token
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/keystone-manage | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/bin/keystone-manage b/bin/keystone-manage index 4bcd5d78..ff97f7e4 100755 --- a/bin/keystone-manage +++ b/bin/keystone-manage @@ -1,5 +1,6 @@ #!/usr/bin/env python +import logging import os import sys import textwrap @@ -29,7 +30,7 @@ config.register_cli_str('endpoint', default='http://localhost:$admin_port/v2.0', #group='ks', conf=CONF) -config.register_cli_str('token', +config.register_cli_str('auth_token', default='$admin_token', #group='ks', help='asdasd', @@ -88,10 +89,9 @@ class ClientCommand(BaseApp): self.ACTION_MAP = {'help': 'help'} self.add_param('action', nargs='?', default='help') self.add_param('keyvalues', nargs='*') - self.client = kc.Client(CONF.endpoint, token=CONF.token) + self.client = kc.Client(CONF.endpoint, token=CONF.auth_token) self.handle = getattr(self.client, '%ss' % self.__class__.__name__.lower()) self._build_action_map() - self.usage = "foo" def _build_action_map(self): actions = {} @@ -108,7 +108,13 @@ class ClientCommand(BaseApp): sys.exit(1) kv = self._parse_keyvalues(self.params.keyvalues) - resp = getattr(self.handle, action_name)(**kv) + try: + f = getattr(self.handle, action_name) + resp = f(**kv) + except Exception: + logging.exception('') + raise + if CONF.id_only and getattr(resp, 'id'): print resp.id return |