diff options
| author | Dean Troyer <dtroyer@gmail.com> | 2013-08-13 17:14:42 -0500 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2013-08-23 12:08:32 -0500 |
| commit | 17f13f7bf4cea80e8e1380fbc8295318de5be383 (patch) | |
| tree | 611a7a512eae39341911db529b36035d737730e2 /openstackclient/shell.py | |
| parent | b440986e6e0e90c220fe3e52f893bc5dd51cae5a (diff) | |
| download | python-openstackclient-17f13f7bf4cea80e8e1380fbc8295318de5be383.tar.gz | |
Create a new base REST API interface
* restapi module provides basic REST API support
* uses dicts rather than Resource classes
* JSON serialization/deserialization
* log requests in 'curl' format
* basic API boilerplate for create/delete/list/set/show verbs
* ignore H302 due to urllib import
Change-Id: I3cb91e44e631ee19e9f5dea19b6bac5d599d19ce
Diffstat (limited to 'openstackclient/shell.py')
| -rw-r--r-- | openstackclient/shell.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/openstackclient/shell.py b/openstackclient/shell.py index b66611b1..91b02a2b 100644 --- a/openstackclient/shell.py +++ b/openstackclient/shell.py @@ -29,6 +29,7 @@ from openstackclient.common import clientmanager from openstackclient.common import commandmanager from openstackclient.common import exceptions as exc from openstackclient.common import openstackkeyring +from openstackclient.common import restapi from openstackclient.common import utils @@ -368,6 +369,9 @@ class OpenStackShell(app.App): if self.options.deferred_help: self.DeferredHelpAction(self.parser, self.parser, None, None) + # Set up common client session + self.restapi = restapi.RESTApi() + # If the user is not asking for help, make sure they # have given us auth. cmd_name = None @@ -376,6 +380,7 @@ class OpenStackShell(app.App): cmd_factory, cmd_name, sub_argv = cmd_info if self.interactive_mode or cmd_name != 'help': self.authenticate_user() + self.restapi.set_auth(self.client_manager.identity.auth_token) def prepare_to_run_command(self, cmd): """Set up auth and API versions""" |
