diff --git a/zaza/openstack/charm_tests/ironic/tests.py b/zaza/openstack/charm_tests/ironic/tests.py index deba8ab01..b6c53809e 100644 --- a/zaza/openstack/charm_tests/ironic/tests.py +++ b/zaza/openstack/charm_tests/ironic/tests.py @@ -22,7 +22,8 @@ def _get_ironic_client(ironic_api_version="1.58"): - keystone_session = openstack_utils.get_overcloud_keystone_session() + keystone_session = openstack_utils.get_overcloud_keystone_session( + scope='system') ironic = ironic_client.Client(1, session=keystone_session, os_ironic_api_version=ironic_api_version) return ironic diff --git a/zaza/openstack/utilities/openstack.py b/zaza/openstack/utilities/openstack.py index e87f8547d..143472e0e 100644 --- a/zaza/openstack/utilities/openstack.py +++ b/zaza/openstack/utilities/openstack.py @@ -574,19 +574,21 @@ def get_keystone_session(openrc_creds, scope='PROJECT', verify=None): return session.Session(auth=auth, verify=verify) -def get_overcloud_keystone_session(verify=None, model_name=None): +def get_overcloud_keystone_session(verify=None, model_name=None, scope=None): """Return Over cloud keystone session. :param verify: Control TLS certificate verification behaviour :type verify: any :param model_name: Name of model to query. :type model_name: str + :param scope: Keystone scope + :type scope: str :returns keystone_session: keystoneauth1.session.Session object :rtype: keystoneauth1.session.Session """ return get_keystone_session( get_overcloud_auth(model_name=model_name), - scope=get_keystone_scope(model_name=model_name), + scope=scope or get_keystone_scope(model_name=model_name), verify=verify)