Small fix of adding role to the user
Made a small fix of adding role to the user: setting clear
variables. In the corner case when the 'admin' user is
not present, or it is has other username, or the domain is
different, the tests tried to find the only "admin" user in
the default domain only.
Also, there is a couple of minor fixes according to the PEP8
codestyle.
Related-PROD: PROD-36943
Change-Id: Ic891c4b54479adf85f88081d742cb7af45fc4639
diff --git a/fixtures/base.py b/fixtures/base.py
index d1434dd..ed00d80 100644
--- a/fixtures/base.py
+++ b/fixtures/base.py
@@ -115,8 +115,10 @@
# create alt project with regular admin user
tmp_os_actions = os_client.OSCliActions(openstack_clients)
alt_project = tmp_os_actions.create_project()
- tmp_os_actions.add_roles_to_user_in_project(alt_project.id)
-
+ tmp_os_actions.add_roles_to_user_in_project(
+ alt_project.id, username=os.environ['OS_USERNAME'],
+ domain=os.environ['OS_PROJECT_DOMAIN_NAME']
+ )
# create a client using alt project with admin user in it
return os_client.OfficialClientManager(
username=os.environ['OS_USERNAME'],