diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-09-06 23:54:42 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-09-06 23:54:42 +0000 |
| commit | cb63eb9533609007c5b3be64ca2c859110d2502e (patch) | |
| tree | 43ca79a3b4adba4b4b2c6e0f4ca07541f33ee2b6 | |
| parent | daf0681f064cf1de54f9c91f44737c31bf196d92 (diff) | |
| parent | 25b0b58c9595f8600664aa5c49504e44eed80859 (diff) | |
Merge "Allow cinder catalog match values to be configured"
| -rw-r--r-- | nova/volume/cinder.py | 16 |
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) |
