diff options
-rw-r--r-- | README.rst | 8 | ||||
-rw-r--r-- | os_client_config/config.py | 2 | ||||
-rw-r--r-- | os_client_config/tests/test_config.py | 7 |
3 files changed, 13 insertions, 4 deletions
@@ -117,7 +117,7 @@ An example config file is probably helpful: - IAD You may note a few things. First, since `auth_url` settings are silly -and embarrasingly ugly, known cloud vendor profile information is included and +and embarrassingly ugly, known cloud vendor profile information is included and may be referenced by name. One of the benefits of that is that `auth_url` isn't the only thing the vendor defaults contain. For instance, since Rackspace lists `rax:database` as the service type for trove, `os-client-config` @@ -148,8 +148,8 @@ related to domains, projects and trusts. Splitting Secrets ----------------- -In some scenarios, such as configuragtion managment controlled environments, -it might be eaiser to have secrets in one file and non-secrets in another. +In some scenarios, such as configuration management controlled environments, +it might be easier to have secrets in one file and non-secrets in another. This is fully supported via an optional file `secure.yaml` which follows all the same location rules as `clouds.yaml`. It can contain anything you put in `clouds.yaml` and will take precedence over anything in the `clouds.yaml` @@ -380,4 +380,4 @@ If you want to do the same thing but also support command line parsing. 'compute', options=argparse.ArgumentParser()) If you want to get fancier than that in your python, then the rest of the -API is avaiable to you. But often times, you just want to do the one thing. +API is available to you. But often times, you just want to do the one thing. diff --git a/os_client_config/config.py b/os_client_config/config.py index 5101983..b572645 100644 --- a/os_client_config/config.py +++ b/os_client_config/config.py @@ -395,6 +395,8 @@ class OpenStackConfig(object): return [self._expand_region_name(new_cloud['region_name'])] def _get_region(self, cloud=None, region_name=''): + if region_name is None: + region_name = '' if not cloud: return self._expand_region_name(region_name) diff --git a/os_client_config/tests/test_config.py b/os_client_config/tests/test_config.py index aef9737..4440ac8 100644 --- a/os_client_config/tests/test_config.py +++ b/os_client_config/tests/test_config.py @@ -246,6 +246,13 @@ class TestConfig(base.TestCase): region_name='override-region') self.assertEqual(region, {'name': 'override-region', 'values': {}}) + def test_get_region_region_is_none(self): + c = config.OpenStackConfig(config_files=[self.cloud_yaml], + vendor_files=[self.vendor_yaml], + secure_files=[self.no_yaml]) + region = c._get_region(cloud='_test-cloud_no_region', region_name=None) + self.assertEqual(region, {'name': '', 'values': {}}) + def test_get_region_region_set(self): c = config.OpenStackConfig(config_files=[self.cloud_yaml], vendor_files=[self.vendor_yaml], |