Skip to content

Commit

Permalink
tempest: Refactor _add_application_ips.
Browse files Browse the repository at this point in the history
Perform repetitive task in loop on input data rather than
repeating the same call three times in the code.

Signed-off-by: Frode Nordahl <[email protected]>
  • Loading branch information
fnordahl committed Oct 11, 2024
1 parent 115c4e7 commit a9f7794
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions zaza/openstack/charm_tests/tempest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,10 @@ def _add_application_ips(ctxt):
:returns: None
:rtype: None
"""
ctxt['keystone'] = juju_utils.get_application_ip('keystone')
ctxt['dashboard'] = juju_utils.get_application_ip('openstack-dashboard')
ctxt['ncc'] = juju_utils.get_application_ip('nova-cloud-controller')
for ctxt_key, application_name in (('keystone', 'keystone'),
('dashboard', 'openstack-dashboard'),
('ncc', 'nova-cloud-controller')):
ctxt[ctxt_key] = zaza_juju_utils.get_application_ip(application_name)


def _add_nova_config(ctxt, keystone_session, missing_fatal=True):
Expand Down

0 comments on commit a9f7794

Please sign in to comment.