[FT] Check "Port_Binding" register exists before checking type

In "test_virtual_port_host_update_upon_failover", it is needed to check
if the "Port_Binding" register exists before checking the type.

Closes-Bug: #2055886
Change-Id: I8a6b3498803bcba592a82dfbe43a39137dd12fa2
This commit is contained in:
Rodolfo Alonso Hernandez 2024-03-04 14:00:07 +00:00
parent 96558ac77a
commit 8b007e6366
1 changed files with 2 additions and 0 deletions

View File

@ -334,6 +334,8 @@ class TestNBDbMonitor(base.TestOVNFunctionalBase):
def _check_port_binding_type(self, port_id, port_type):
def is_port_binding_type(port_id, port_type):
bp = self._find_port_binding(port_id)
if not bp:
return False
return port_type == bp.type
check = functools.partial(is_port_binding_type, port_id, port_type)