diff options
author | Julia Kreger <juliaashleykreger@gmail.com> | 2015-02-08 13:06:49 -0500 |
---|---|---|
committer | Julia Kreger <juliaashleykreger@gmail.com> | 2015-02-11 10:12:23 -0500 |
commit | 56b75154fb4858fad5f1d7a910d5d7fbf785ef67 (patch) | |
tree | d96b5c2290ffd940096156759363e1565c4e77c0 | |
parent | 89d1e4d3c4cbbe67d60c5b96cfb8ae6762737fd2 (diff) | |
download | os-client-config-56b75154fb4858fad5f1d7a910d5d7fbf785ef67.tar.gz |
Allow region_name to be None
When using the shade library with ansible playbooks and classical
environment variables for authentication, it is possible for a
region_name value to be passed in with the value of None.
When the value is set to and preserved as None, the logic later
on in the method will fail to create a config key/value entry for
region_name which is required by code later on in the method.
Modified the region_name check to not only check for the presence
of a missing region_name value, but to check to see if that value
is set to None. This allows the value to be reset preventing the
method from failing on the return call due to a missing key.
Change-Id: Id8a3edf53ac751f0c6ee4d71405a926ba90c0602
-rw-r--r-- | os_client_config/config.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/os_client_config/config.py b/os_client_config/config.py index 72c24f9..ae19621 100644 --- a/os_client_config/config.py +++ b/os_client_config/config.py @@ -271,7 +271,7 @@ class OpenStackConfig(object): args = self._fix_args(kwargs, argparse=argparse) - if 'region_name' not in args: + if 'region_name' not in args or args['region_name'] is None: args['region_name'] = self._get_region(cloud) config = self._get_base_cloud_config(cloud) |