Skip to content

Commit 29d53ca

Browse files
committed
1 parent 54db9fc commit 29d53ca

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

development/shared/neutron-ext-net-ksv3

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,21 @@ if __name__ == '__main__':
7171
keystone = v3.Client(session=sess)
7272
quantum = client.Client(session=sess)
7373

74+
# Resolve domain id
75+
domain_id = None
76+
for dom in [t._info for t in keystone.domains.list()]:
77+
if (dom['name'] == (os.environ['OS_PROJECT_DOMAIN_NAME'])):
78+
domain_id = dom['id']
79+
break # Domain ID found - stop looking
80+
if not domain_id:
81+
logging.error("Unable to locate domain for %s.", os.environ['OS_PROJECT_DOMAIN_NAME']);
82+
7483
# Resolve tenant id
75-
project_id = auth.get_project_id(sess)
84+
project_id = None
85+
for proj in [t._info for t in keystone.projects.list()]:
86+
if (proj['domain_id'] == domain_id and proj['name'] == (opts.project or os.environ['OS_PROJECT_NAME'])):
87+
project_id = proj['id']
88+
break # Tenant ID found - stop looking
7689
if not project_id:
7790
logging.error("Unable to locate project id for %s.", opts.tenant)
7891
sys.exit(1)

0 commit comments

Comments
 (0)