Add auth_version config option

Change-Id: Iba84890437a0b7ba0fa00a9bd893fe2ef7f9b797
Closes-Bug: #1683995
This commit is contained in:
rabi 2017-04-19 09:21:54 +05:30
parent d58ca4f0e7
commit eed9cf85ca
3 changed files with 11 additions and 6 deletions

View File

@ -71,11 +71,13 @@ class ClientManager(object):
self.conf = conf
self.admin_credentials = admin_credentials
if self.conf.auth_url.find('/v'):
self.auth_version = self.conf.auth_url.split('/v')[1]
else:
raise ValueError(_('Incorrectly specified auth_url config: no '
'version found.'))
self.auth_version = self.conf.auth_version
if not self.auth_version:
try:
self.auth_version = self.conf.auth_url.split('/v')[1]
except IndexError:
raise ValueError(_('Please specify version in auth_url or '
'auth_version in config.'))
self.insecure = self.conf.disable_ssl_certificate_validation
self.ca_file = self.conf.ca_file

View File

@ -50,7 +50,9 @@ HeatGroup = [
deprecated_opts=[cfg.DeprecatedOpt('admin_tenant_name',
group='heat_plugin')]),
cfg.StrOpt('auth_url',
help="Full URI of the OpenStack Identity API (Keystone)"),
help="Full URI of the OpenStack Identity API (Keystone)."),
cfg.StrOpt('auth_version',
help="OpenStack Identity API version."),
cfg.StrOpt('user_domain_name',
help="User domain name, if keystone v3 auth_url "
"is used"),

View File

@ -38,6 +38,7 @@ iniset $conf_file heat_plugin project_domain_id $OS_PROJECT_DOMAIN_ID
iniset $conf_file heat_plugin user_domain_name $OS_USER_DOMAIN_NAME
iniset $conf_file heat_plugin project_domain_name $OS_PROJECT_DOMAIN_NAME
iniset $conf_file heat_plugin region $OS_REGION_NAME
iniset $conf_file heat_plugin auth_version $OS_IDENTITY_API_VERSION
source $DEST/devstack/openrc admin admin
iniset $conf_file heat_plugin admin_username $OS_USERNAME