Skip to content

Commit

Permalink
Testing fix suggested in
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewdmcleod committed Nov 30, 2018
1 parent 54db9fc commit 40f7b99
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
15 changes: 14 additions & 1 deletion development/shared/neutron-ext-net-ksv3
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,21 @@ if __name__ == '__main__':
keystone = v3.Client(session=sess)
quantum = client.Client(session=sess)

# Resolve domain id
domain_id = None
for dom in [t._info for t in keystone.domains.list()]:
if (dom['name'] == (os.environ['OS_PROJECT_DOMAIN_NAME'])):
domain_id = dom['id']
break # Domain ID found - stop looking
if not domain_id:
logging.error("Unable to locate domain for %s.", os.environ['OS_PROJECT_DOMAIN_NAME']);

# Resolve tenant id
project_id = auth.get_project_id(sess)
project_id = None
for proj in [t._info for t in keystone.projects.list()]:
if (proj['domain_id'] == domain_id and proj['name'] == (opts.project or os.environ['OS_PROJECT_NAME'])):
project_id = proj['id']
break # Tenant ID found - stop looking
if not project_id:
logging.error("Unable to locate project id for %s.", opts.tenant)
sys.exit(1)
Expand Down
15 changes: 14 additions & 1 deletion development/shared/neutron-tenant-net-ksv3
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,21 @@ if __name__ == '__main__':
keystone = v3.Client(session=sess)
quantum = client.Client(session=sess)

# Resolve domain id
domain_id = None
for dom in [t._info for t in keystone.domains.list()]:
if (dom['name'] == (os.environ['OS_PROJECT_DOMAIN_NAME'])):
domain_id = dom['id']
break # Domain ID found - stop looking
if not domain_id:
logging.error("Unable to locate domain for %s.", os.environ['OS_PROJECT_DOMAIN_NAME']);

# Resolve tenant id
project_id = auth.get_project_id(sess)
project_id = None
for proj in [t._info for t in keystone.projects.list()]:
if (proj['domain_id'] == domain_id and proj['name'] == (opts.project or os.environ['OS_PROJECT_NAME'])):
project_id = proj['id']
break # Tenant ID found - stop looking
if not project_id:
logging.error("Unable to locate project id for %s.", opts.tenant)
sys.exit(1)
Expand Down

0 comments on commit 40f7b99

Please sign in to comment.