From e344821225d0f44461eff9376de8509660ecd4e1 Mon Sep 17 00:00:00 2001 From: termie Date: Mon, 23 Jan 2012 17:47:48 -0800 Subject: fix token vs auth_token --- bin/keystone-manage | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'bin') 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 -- cgit