Fix check_floating_ip_status utility's output
floating_ip variable contains an old state of the floating ip - the state
which was correct before calling refresh method. In order to have the
latest floating ip data after calling refresh, the patch creates a class
as a wrapper around the refreshing ip's state and logging it.
Closes-Bug: 1788416
Change-Id: I83ca08ef77c243762210837bad800ce0c4d09fb5
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index efdfe8e..8591771 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -1038,9 +1038,12 @@
floatingip_id = floating_ip['id']
def refresh():
- result = (self.floating_ips_client.
- show_floatingip(floatingip_id)['floatingip'])
- return status == result['status']
+ floating_ip = (self.floating_ips_client.
+ show_floatingip(floatingip_id)['floatingip'])
+ if status == floating_ip['status']:
+ LOG.info("FloatingIP: {fp} is at status: {st}"
+ .format(fp=floating_ip, st=status))
+ return status == floating_ip['status']
if not test_utils.call_until_true(refresh,
CONF.network.build_timeout,
@@ -1052,8 +1055,6 @@
"failed to reach status: {st}"
.format(fp=floating_ip, cst=floating_ip['status'],
st=status))
- LOG.info("FloatingIP: {fp} is at status: {st}"
- .format(fp=floating_ip, st=status))
def check_tenant_network_connectivity(self, server,
username,