Re Fix test_rebuild_server test by waiting for floating ip

It was originally attempted to be fixed in [1][2] but
the issue is still observed as fip wait was done
on wrong server instead the one created as part of test.

[1] https://review.opendev.org/c/openstack/tempest/+/814085
[2] https://review.opendev.org/c/openstack/tempest/+/828245

Closes-Bug: #1945495
Change-Id: I25b553e547baece65223ba884ef440fca65e5b64
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index ccbbd68..10153bb 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -45,15 +45,6 @@
         try:
             self.validation_resources = self.get_class_validation_resources(
                 self.os_primary)
-            # _test_rebuild_server test compares ip address attached to the
-            # server before and after the rebuild, in order to avoid
-            # 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.client,
-                self.client.show_server(self.server_id)['server'],
-                self.validation_resources['floating_ip'])
             waiters.wait_for_server_status(self.client,
                                            self.server_id, 'ACTIVE')
         except lib_exc.NotFound:
@@ -282,6 +273,15 @@
             validation_resources=validation_resources,
             tenant_network=tenant_network)
         server = servers[0]
+        # _test_rebuild_server test compares ip address attached to the
+        # server before and after the rebuild, in order to avoid
+        # 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.client,
+            server,
+            validation_resources['floating_ip'])
 
         self.addCleanup(waiters.wait_for_server_termination,
                         self.client, server['id'])