Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ironic system scope #1245

Draft
wants to merge 2 commits into
base: stable/caracal
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion zaza/openstack/charm_tests/ironic/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions zaza/openstack/utilities/openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
Loading