Fix caught exception from disrupt_controller_galera_main_vip

Originally the port searched in this function was obtained using a CLI
command and the expected exception was ShellCommandFailed, accordingly.
Finally, the method to obtain the port was changed to neutron.find_port,
but the expected exception was not updated. This patch replaces the
ShellCommandFailed exception by ObjectNotFound.

Change-Id: I7035c224b50a4ccad6950c0a6ca935c9bdb7adc7
This commit is contained in:
Eduardo Olivares 2023-03-16 03:55:03 +01:00
parent e77aca7d39
commit e645cf6ac2
1 changed files with 5 additions and 5 deletions

View File

@ -286,18 +286,18 @@ def disrupt_controller_galera_main_vip(disrupt_method=sh.soft_reset_method):
# This case reboots controller while VM creation is in progress
# Please refer to RHBZ#2124877 for more info
# Find the Galera VIP (port name : internal_api_virtual_ip)
session = tripleo.undercloud_keystone_session()
uc_neutron_client = neutron.get_neutron_client(session=session)
try:
session = tripleo.undercloud_keystone_session()
uc_neutron_client = neutron.get_neutron_client(session=session)
new_port = neutron.find_port(client=uc_neutron_client, unique=False,
name='internal_api_virtual_ip')
galera_vip_address = new_port['fixed_ips'][0]['ip_address']
LOG.info("The Galera VIP address is: %r", galera_vip_address)
except sh.ShellCommandFailed as no_internal_api:
except tobiko.ObjectNotFound as no_internal_api:
raise tobiko.SkipException(
'This OSP environment doesnt have an internal_api \
network, so this test cannot be executed') from no_internal_api
galera_vip_address = new_port['fixed_ips'][0]['ip_address']
LOG.info("The Galera VIP address is: %r", galera_vip_address)
# Find the controller hosting VIP resource
galera_vip_resource = "ip-"+galera_vip_address
galera_vip_controller = pacemaker.get_overcloud_nodes_running_pcs_resource(