File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments