diff options
| author | ting.wang <ting.wang@easystack.cn> | 2016-02-20 14:28:08 +0800 |
|---|---|---|
| committer | ting.wang <ting.wang@easystack.cn> | 2016-02-21 13:21:31 +0800 |
| commit | e2158b7ef4c307ff5be7bd2ef0ca3044f37759d4 (patch) | |
| tree | f42047689a1b39d5c3bdf078261d7a277fcdbed2 /openstackclient/common/clientmanager.py | |
| parent | 867bcb0db8742fd2daa5c91dfd3c164ac4178f18 (diff) | |
| download | python-openstackclient-e2158b7ef4c307ff5be7bd2ef0ca3044f37759d4.tar.gz | |
Clean redundant argument to dict.get
`dict.get()` returns `None` by default, if a key wasn't found.
Removing `None` as second argument to avoid redundancy.
Change-Id: Ia82f7469cd019509bbeccbfe54b15eeedc7bb6ea
Diffstat (limited to 'openstackclient/common/clientmanager.py')
| -rw-r--r-- | openstackclient/common/clientmanager.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/openstackclient/common/clientmanager.py b/openstackclient/common/clientmanager.py index 78a0ae6e..fd88bdec 100644 --- a/openstackclient/common/clientmanager.py +++ b/openstackclient/common/clientmanager.py @@ -90,7 +90,7 @@ class ClientManager(object): self._cli_options = cli_options self._api_version = api_version self._pw_callback = pw_func - self._url = self._cli_options.auth.get('url', None) + self._url = self._cli_options.auth.get('url') self._region_name = self._cli_options.region_name self._interface = self._cli_options.interface @@ -146,7 +146,7 @@ class ClientManager(object): # Horrible hack alert...must handle prompt for null password if # password auth is requested. if (self.auth_plugin_name.endswith('password') and - not self._cli_options.auth.get('password', None)): + not self._cli_options.auth.get('password')): self._cli_options.auth['password'] = self._pw_callback() (auth_plugin, self._auth_params) = auth.build_auth_params( @@ -162,9 +162,9 @@ class ClientManager(object): # PROJECT_DOMAIN_ID to 'OS_DEFAULT_DOMAIN' for better usability. if (self._api_version.get('identity') == '3' and self.auth_plugin_name.endswith('password') and - not self._auth_params.get('project_domain_id', None) and + not self._auth_params.get('project_domain_id') and not self.auth_plugin_name.startswith('v2') and - not self._auth_params.get('project_domain_name', None)): + not self._auth_params.get('project_domain_name')): self._auth_params['project_domain_id'] = default_domain # NOTE(stevemar): If USER_DOMAIN_ID or USER_DOMAIN_NAME is present, @@ -173,8 +173,8 @@ class ClientManager(object): if (self._api_version.get('identity') == '3' and self.auth_plugin_name.endswith('password') and not self.auth_plugin_name.startswith('v2') and - not self._auth_params.get('user_domain_id', None) and - not self._auth_params.get('user_domain_name', None)): + not self._auth_params.get('user_domain_id') and + not self._auth_params.get('user_domain_name')): self._auth_params['user_domain_id'] = default_domain # For compatibility until all clients can be updated |
