diff options
Diffstat (limited to 'openstackclient/shell.py')
| -rw-r--r-- | openstackclient/shell.py | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/openstackclient/shell.py b/openstackclient/shell.py index da985cbc..136542dc 100644 --- a/openstackclient/shell.py +++ b/openstackclient/shell.py @@ -182,24 +182,26 @@ class OpenStackShell(app.App): parser.add_argument( '--os-cacert', metavar='<ca-bundle-file>', + dest='cacert', default=utils.env('OS_CACERT'), help='CA certificate bundle file (Env: OS_CACERT)') verify_group = parser.add_mutually_exclusive_group() verify_group.add_argument( '--verify', + action='store_true', default=None, - action='store_false', help='Verify server certificate (default)', ) verify_group.add_argument( '--insecure', - default=None, action='store_true', + default=None, help='Disable server certificate verification', ) parser.add_argument( '--os-default-domain', metavar='<auth-domain>', + dest='default_domain', default=utils.env( 'OS_DEFAULT_DOMAIN', default=DEFAULT_DOMAIN), @@ -234,6 +236,23 @@ class OpenStackShell(app.App): cloud_config.set_default('auth_type', 'osc_password') self.log.debug("options: %s", self.options) + project_id = getattr(self.options, 'project_id', None) + project_name = getattr(self.options, 'project_name', None) + tenant_id = getattr(self.options, 'tenant_id', None) + tenant_name = getattr(self.options, 'tenant_name', None) + + # handle some v2/v3 authentication inconsistencies by just acting like + # both the project and tenant information are both present. This can + # go away if we stop registering all the argparse options together. + if project_id and not tenant_id: + self.options.tenant_id = project_id + if project_name and not tenant_name: + self.options.tenant_name = project_name + if tenant_id and not project_id: + self.options.project_id = tenant_id + if tenant_name and not project_name: + self.options.project_name = tenant_name + # Do configuration file handling cc = cloud_config.OpenStackConfig() self.log.debug("defaults: %s", cc.defaults) @@ -253,7 +272,7 @@ class OpenStackShell(app.App): self.verify = self.cloud.config.get('verify', self.verify) # Save default domain - self.default_domain = self.options.os_default_domain + self.default_domain = self.options.default_domain # Loop through extensions to get API versions for mod in clientmanager.PLUGIN_MODULES: |
