[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
(cherry picked from commit 8b007e63664ef811671554b7c878cb552078aa99)
This commit is contained in:
Rodolfo Alonso Hernandez 2024-03-04 14:00:07 +00:00 committed by yatin
parent 5315de1cc6
commit 94b58527f4

View File

@ -333,6 +333,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)