diff options
| author | Dean Troyer <dtroyer@gmail.com> | 2012-04-27 11:49:01 -0500 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2012-04-27 11:49:15 -0500 |
| commit | 2f2191b9edc324f7a064a2229e2037bb0d6f4dcb (patch) | |
| tree | f1be94ea8173c353d67a460c1126cb7ee69ab52b /openstackclient/shell.py | |
| parent | 60ed9aaa8aa72ecff420d303765d29f24a78bbc2 (diff) | |
| download | python-openstackclient-2f2191b9edc324f7a064a2229e2037bb0d6f4dcb.tar.gz | |
Add token auth to shell and README
Diffstat (limited to 'openstackclient/shell.py')
| -rw-r--r-- | openstackclient/shell.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/openstackclient/shell.py b/openstackclient/shell.py index f01b76c9..cd7a50ba 100644 --- a/openstackclient/shell.py +++ b/openstackclient/shell.py @@ -70,12 +70,12 @@ class OpenStackShell(App): :param tenant_name: name of tenant :param auth_url: endpoint to authenticate against """ - _ksclient = ksclient.Client(username=kwargs.get('username'), + self.ksclient = ksclient.Client(username=kwargs.get('username'), password=kwargs.get('password'), tenant_id=kwargs.get('tenant_id'), tenant_name=kwargs.get('tenant_name'), auth_url=kwargs.get('auth_url')) - return _ksclient.auth_token + return self.ksclient.auth_token def build_option_parser(self, description, version): parser = super(OpenStackShell, self).build_option_parser( @@ -178,9 +178,12 @@ class OpenStackShell(App): 'auth_url': self.options.os_auth_url } token = self._authenticate(**kwargs) - # get service catalog via cmd.api - # get client instance here - print "api: %s" % cmd.api + endpoint = self.ksclient.service_catalog.url_for(service_type=cmd.api) + + if self.options.debug: + print "api: %s" % cmd.api + print "token: %s" % token + print "endpoint: %s" % endpoint def clean_up(self, cmd, result, err): self.log.debug('clean_up %s', cmd.__class__.__name__) |
