Add a conditional check for floating ip in rebuild server

We check to see if the floating ip exists in validation resources
before waiting for it to finish provisioning. In some scenarios
floating ip's are disabled which would cause this test to fail

Closes-Bug: #2132971
Change-Id: I687eb36c567be91419de6de37a90e4895ae16fb2
Signed-off-by: Ian Watson <ianwatson92@hotmail.co.uk>
Signed-off-by: Jan Horstmann <horstmann@osism.tech>
This commit is contained in:
Ian Watson
2025-11-26 09:48:19 +00:00
committed by Jan Horstmann
parent 9dac5e6979
commit 7e3c572a7a
2 changed files with 10 additions and 4 deletions

View File

@@ -0,0 +1,5 @@
---
fixes:
- |
Fixed bug #2132971. ``test_rebuild_server`` will no longer expect a
floating ip when floating ip networks are disabled.

View File

@@ -283,10 +283,11 @@ class ServerActionsTestJSON(ServerActionsBase):
# a situation when a newly created server doesn't have a floating
# ip attached at the beginning of the test_rebuild_server let's
# make sure right here the floating ip is attached
waiters.wait_for_server_floating_ip(
self.servers_client,
server,
validation_resources['floating_ip'])
if 'floating_ip' in validation_resources:
waiters.wait_for_server_floating_ip(
self.servers_client,
server,
validation_resources['floating_ip'])
self.addCleanup(waiters.wait_for_server_termination,
self.servers_client, server['id'])