diff options
| author | Rohit Karajgi <rohit.karajgi@nttdata.com> | 2013-01-07 03:22:16 -0800 |
|---|---|---|
| committer | Rohit Karajgi <rohit.karajgi@nttdata.com> | 2013-01-09 04:10:05 -0800 |
| commit | 4db98faa1c55c6f369ec84ed478338141ad5e7d8 (patch) | |
| tree | e1ab4e33697638e7de9dc6f402eef155e30122ea | |
| parent | 1db4b13d86d748d9619ea9ce37bb4663285468b5 (diff) | |
| download | nova-4db98faa1c55c6f369ec84ed478338141ad5e7d8.tar.gz nova-4db98faa1c55c6f369ec84ed478338141ad5e7d8.tar.xz nova-4db98faa1c55c6f369ec84ed478338141ad5e7d8.zip | |
Adds a flag to allow configuring a region
If multiple regions contain an endpoint, extract
the correct endpoint URL from the os_region_name parameter
in nova.conf
Fixes LP Bug #1087735
Change-Id: Id4e4f56f336cd2b092a173b3c8e695b173c76f2a
| -rw-r--r-- | nova/volume/cinder.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/nova/volume/cinder.py b/nova/volume/cinder.py index 514295605..fccdedac8 100644 --- a/nova/volume/cinder.py +++ b/nova/volume/cinder.py @@ -42,6 +42,9 @@ cinder_opts = [ default=None, help='Override service catalog lookup with template for cinder ' 'endpoint e.g. http://localhost:8776/v1/%(project_id)s'), + cfg.StrOpt('os_region_name', + default=None, + help='region name of this node'), cfg.IntOpt('cinder_http_retries', default=3, help='Number of cinderclient retries on failed http calls'), @@ -66,7 +69,16 @@ def cinderclient(context): else: info = CONF.cinder_catalog_info service_type, service_name, endpoint_type = info.split(':') - url = sc.url_for(service_type=service_type, + # extract the region if set in configuration + if CONF.os_region_name: + attr = 'region' + filter_value = CONF.os_region_name + else: + attr = None + filter_value = None + url = sc.url_for(attr=attr, + filter_value=filter_value, + service_type=service_type, service_name=service_name, endpoint_type=endpoint_type) |
