Use domain env variables as defaults

Use OS_USER_DOMAIN_NAME and OS_PROJECT_DOMAIN_NAME
env variables as the defaults for keystone v3 in
integration tests.

Change-Id: Idb58431cf95988a91504ccac5116e0f8e339578f
Closes-Bug: #1560032
This commit is contained in:
Rabi Mishra 2016-03-21 21:09:20 +05:30
parent 8b02644d63
commit 55713b94bf
3 changed files with 25 additions and 13 deletions

View File

@ -110,7 +110,8 @@ class ClientManager(object):
password=self.conf.password)
def _get_identity_client(self):
domain = self.conf.domain_name
user_domain_name = self.conf.user_domain_name
project_domain_name = self.conf.project_domain_name
kwargs = {
'username': self.conf.username,
'password': self.conf.password,
@ -120,8 +121,8 @@ class ClientManager(object):
# keystone v2 can't ignore domain details
if self.auth_version == '3':
kwargs.update({
'project_domain_name': domain,
'user_domain_name': domain})
'user_domain_name': user_domain_name,
'project_domain_name': project_domain_name})
auth = password.Password(**kwargs)
if self.insecure:
verify_cert = False
@ -196,7 +197,8 @@ class ClientManager(object):
return swift_client.Connection(**args)
def _get_metering_client(self):
domain = self.conf.domain_name
user_domain_name = self.conf.user_domain_name
project_domain_name = self.conf.project_domain_name
try:
endpoint = self.identity_client.get_endpoint_url('metering',
self.conf.region)
@ -218,8 +220,8 @@ class ClientManager(object):
# v2 auth_url
if self.auth_version == '3':
args.update(
{'user_domain_name': domain,
'project_domain_name': domain})
{'user_domain_name': user_domain_name,
'project_domain_name': project_domain_name})
return ceilometer_client.Client(self.CEILOMETER_VERSION,
endpoint, **args)

View File

@ -38,9 +38,13 @@ IntegrationTestGroup = [
cfg.StrOpt('auth_url',
default=os.environ.get('OS_AUTH_URL'),
help="Full URI of the OpenStack Identity API (Keystone)"),
cfg.StrOpt('domain_name',
default='default',
help="User/project domain name, if keystone v3 auth_url"
cfg.StrOpt('user_domain_name',
default=os.environ.get('OS_USER_DOMAIN_NAME'),
help="User domain name, if keystone v3 auth_url"
"is used"),
cfg.StrOpt('project_domain_name',
default=os.environ.get('OS_PROJECT_DOMAIN_NAME'),
help="Project domain name, if keystone v3 auth_url"
"is used"),
cfg.StrOpt('region',
default=os.environ.get('OS_REGION_NAME'),

View File

@ -22,8 +22,11 @@
# Full URI of the OpenStack Identity API (Keystone) (string value)
#auth_url = <None>
# User/project domain name, if keystone v3 auth_urlis used (string value)
#domain_name = default
# User domain name, if keystone v3 auth_urlis used (string value)
#user_domain_name = <None>
# Project domain name, if keystone v3 auth_urlis used (string value)
#project_domain_name = <None>
# The region name to use (string value)
#region = <None>
@ -48,6 +51,9 @@
# Set to True if using self-signed SSL certificates. (boolean value)
#disable_ssl_certificate_validation = false
# CA certificate to pass for servers that have https endpoint. (string value)
#ca_file = <None>
# Time in seconds between build status checks. (integer value)
#build_interval = 4
@ -113,8 +119,8 @@
#sighup_timeout = 30
# Count of retries to edit config file during sighup. If another worker already
# edit config file, file can be busy, so need to wait and try edit file
# again. (integer value)
# edit config file, file can be busy, so need to wait and try edit file again.
# (integer value)
#sighup_config_edit_retries = 10
# Path to the script heat-config-notify (string value)