Merge "Using OS_TENANT_NAME in heat-keystone-setup-domain"

This commit is contained in:
Jenkins 2015-03-24 22:29:13 +00:00 committed by Gerrit Code Review
commit 5aff162525

View File

@ -25,9 +25,10 @@ from heat import version
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
DEBUG = False DEBUG = False
USERNAME = os.environ.get('OS_USERNAME', None) USERNAME = os.environ.get('OS_USERNAME')
PASSWORD = os.environ.get('OS_PASSWORD', None) PASSWORD = os.environ.get('OS_PASSWORD')
AUTH_URL = os.environ.get('OS_AUTH_URL', '').replace('v2.0', 'v3') AUTH_URL = os.environ.get('OS_AUTH_URL', '').replace('v2.0', 'v3')
TENANT_NAME = os.environ.get('OS_TENANT_NAME')
opts = [ opts = [
cfg.StrOpt('stack-user-domain-name', cfg.StrOpt('stack-user-domain-name',
@ -84,23 +85,25 @@ def main():
level=log_lvl) level=log_lvl)
logging.getLogger('urllib3.connectionpool').setLevel(logging.WARNING) logging.getLogger('urllib3.connectionpool').setLevel(logging.WARNING)
if insecure: client_kwargs = {
c = client.Client(debug=DEBUG, 'debug': DEBUG,
username=USERNAME, 'username': USERNAME,
password=PASSWORD, 'password': PASSWORD,
auth_url=AUTH_URL, 'auth_url': AUTH_URL,
endpoint=AUTH_URL, 'endpoint': AUTH_URL,
verify=False) 'tenant_name': TENANT_NAME
else: }
c = client.Client(debug=DEBUG,
username=USERNAME,
password=PASSWORD,
auth_url=AUTH_URL,
endpoint=AUTH_URL,
cacert=CACERT,
cert=CERT,
key=KEY)
if insecure:
client_kwargs['verify'] = False
else:
client_kwargs.update({
'cacert': CACERT,
'cert': CERT,
'key': KEY
})
c = client.Client(**client_kwargs)
c.authenticate() c.authenticate()
# Create the heat domain # Create the heat domain