Skip to contentSkip to conversation

tests/avocado/migration: Get find_free_port() from the ports

PATCH In review Thomas Huth 2 participants 2 messages Aug 29, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/avocado/migration: Get find_free_port() from the ports

In upstream Avocado, the find_free_port() function is not available from "network" anymore, but must be used via "ports", see:

https://github.com/avocado-framework/avocado/commit/22fc98c6ff76cc55c48

To be able to update to a newer Avocado version later, let's use the new way for accessing the find_free_port() function here.

---
 tests/avocado/migration.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/avocado/migration.py +2 -2
index 584d6ef53f..4b25680c50 100644
@@ -14,7 +14,7 @@
 from avocado_qemu import QemuSystemTest
 from avocado import skipUnless
 
-from avocado.utils import network
+from avocado.utils.network import ports
 from avocado.utils import wait
 from avocado.utils.path import find_command
 
@@ -57,7 +57,7 @@ def do_migrate(self, dest_uri, src_uri=None):
         self.assert_migration(source_vm, dest_vm)
 
     def _get_free_port(self):
-        port = network.find_free_port()
+        port = ports.find_free_port()
         if port is None:
             self.cancel('Failed to find a free port')
         return port
Signature · 1 line
2.31.1
Reviewed-by Philippe Mathieu-Daudé on v1 1/1
#1 lore raw
Quoted 5 lines · Thomas Huth

In upstream Avocado, the find_free_port() function is not available from "network" anymore, but must be used via "ports", see:

https://github.com/avocado-framework/avocado/commit/22fc98c6ff76cc55c48

Quoted 7 lines

To be able to update to a newer Avocado version later, let's use the new way for accessing the find_free_port() function here.

---
  tests/avocado/migration.py | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)