From 56b75154fb4858fad5f1d7a910d5d7fbf785ef67 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Sun, 8 Feb 2015 13:06:49 -0500 Subject: 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 --- os_client_config/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit v1.2.1