summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-09-06 23:54:42 +0000
committerGerrit Code Review <review@openstack.org>2012-09-06 23:54:42 +0000
commitcb63eb9533609007c5b3be64ca2c859110d2502e (patch)
tree43ca79a3b4adba4b4b2c6e0f4ca07541f33ee2b6
parentdaf0681f064cf1de54f9c91f44737c31bf196d92 (diff)
parent25b0b58c9595f8600664aa5c49504e44eed80859 (diff)
Merge "Allow cinder catalog match values to be configured"
-rw-r--r--nova/volume/cinder.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/nova/volume/cinder.py b/nova/volume/cinder.py
index 590b7d8a0..9d5222c03 100644
--- a/nova/volume/cinder.py
+++ b/nova/volume/cinder.py
@@ -27,9 +27,19 @@ from cinderclient.v1 import client as cinder_client
from nova.db import base
from nova import exception
from nova import flags
+from nova.openstack.common import cfg
from nova.openstack.common import log as logging
+cinder_opts = [
+ cfg.StrOpt('cinder_catalog_info',
+ default='volume:cinder:publicURL',
+ help='Info to match when looking for cinder in the service '
+ 'catalog. Format is : separated values of the form: '
+ '<service_type>:<service_name>:<endpoint_type>'),
+]
+
FLAGS = flags.FLAGS
+FLAGS.register_opts(cinder_opts)
LOG = logging.getLogger(__name__)
@@ -42,7 +52,11 @@ def cinderclient(context):
'access': {'serviceCatalog': context.service_catalog}
}
sc = service_catalog.ServiceCatalog(compat_catalog)
- url = sc.url_for(service_type='volume', service_name='cinder')
+ info = FLAGS.cinder_catalog_info
+ service_type, service_name, endpoint_type = info.split(':')
+ url = sc.url_for(service_type=service_type,
+ service_name=service_name,
+ endpoint_type=endpoint_type)
LOG.debug(_('Cinderclient connection created using URL: %s') % url)