Skip to content

Commit

Permalink
Use only one of domain id or domain name in openstack
Browse files Browse the repository at this point in the history
  • Loading branch information
nuwang committed Jun 11, 2020
1 parent e6df230 commit d612c4d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions django-cloudlaunch/cloudlaunch/backend_plugins/cloudman2_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,7 @@ def delete_iam():
"username=$os_username\n" \
"password=$os_password\n" \
"auth-url=$os_auth_url\n" \
"domain-id=$os_domain_id\n" \
"domain-name=$os_domain_name\n" \
"$domain_entry\n" \
"region=$os_region\n" \
"tenant-name=$os_tenant_name\n" \
"[BlockStorage]\n" \
Expand Down Expand Up @@ -393,11 +392,15 @@ def _gen_cloud_conf(self, provider_id, cloud_config):
os_ignore_az = self._os_ignore_az(
zone.get('zone_id'),
zone.get('region', {}).get('cloudbridge_settings'))
if creds.get('os_project_domain_id'):
domain_entry = f"domain-id={creds.get('os_project_domain_id')}"
else:
domain_entry = f"domain-name={creds.get('os_project_domain_name')}"

values = {
'os_username': creds.get('os_username'),
'os_password': creds.get('os_password'),
'os_domain_id': creds.get('os_project_domain_id'),
'os_domain_name': creds.get('os_project_domain_name'),
'domain_entry': domain_entry,
'os_tenant_name': creds.get('os_project_name'),
'os_auth_url': zone.get('cloud', {}).get('auth_url'),
'os_region': zone.get('region', {}).get('name'),
Expand Down

0 comments on commit d612c4d

Please sign in to comment.