Remove duplicated code in Dashboard setup (#644)

This commit is contained in:
Chris MacNaughton
2021-10-03 16:54:05 +02:00
committed by GitHub
parent a9d233da46
commit d6dcf4fbd4

View File

@@ -495,17 +495,16 @@ class OpenStackDashboardPolicydTests(policyd.BasePolicydSpecialization,
zaza_model.get_lead_unit_name(self.application_name))
logging.info("Dashboard is at {}".format(unit.public_address))
overcloud_auth = openstack_utils.get_overcloud_auth()
password = overcloud_auth['OS_PASSWORD'],
password = overcloud_auth['OS_PASSWORD']
logging.info("admin password is {}".format(password))
# try to get the url which will either pass or fail with a 403
overcloud_auth = openstack_utils.get_overcloud_auth()
domain = 'admin_domain',
username = 'admin',
password = overcloud_auth['OS_PASSWORD'],
domain = 'admin_domain'
username = 'admin'
client, response = _login(
self.get_horizon_url(), domain, username, password)
# now attempt to get the domains page
_url = self.url.format(unit.public_address)
logging.info("URL is {}".format(_url))
result = client.get(_url)
if result.status_code == 403:
raise policyd.PolicydOperationFailedException("Not authenticated")