diff --git a/ovsdbapp/schema/ovn_northbound/api.py b/ovsdbapp/schema/ovn_northbound/api.py index 5ec93e27..1105d979 100644 --- a/ovsdbapp/schema/ovn_northbound/api.py +++ b/ovsdbapp/schema/ovn_northbound/api.py @@ -1600,15 +1600,15 @@ class API(api.API, metaclass=abc.ABCMeta): """ @abc.abstractmethod - def lsp_detach_mirror(self, port, mirror, if_exist=False): + def lsp_detach_mirror(self, port, mirror, if_exists=False): """Detaches an lsp from the given mirror :param port: the id of the lsp :type port: str :param mirror: the name or ID of the mirror :type mirror: str - :param if_exist: If True, don't fail if the mirror_rules entry + :param if_exists: If True, don't fail if the mirror_rules entry doesn't exist. - :type if_exist: Optional[bool] + :type if_exists: Optional[bool] :returns: :class:`Command` with RowView result """ diff --git a/ovsdbapp/schema/ovn_northbound/commands.py b/ovsdbapp/schema/ovn_northbound/commands.py index 365ada89..3518c978 100644 --- a/ovsdbapp/schema/ovn_northbound/commands.py +++ b/ovsdbapp/schema/ovn_northbound/commands.py @@ -1293,17 +1293,17 @@ class LspAttachMirror(cmd.BaseCommand): class LspDetachMirror(cmd.BaseCommand): - def __init__(self, api, port, mirror, if_exist=False): + def __init__(self, api, port, mirror, if_exists=False): super().__init__(api) self.port = port self.mirror = mirror - self.if_exist = if_exist + self.if_exists = if_exists def run_idl(self, txn): try: lsp = self.api.lookup('Logical_Switch_Port', self.port) mirror = self.api.lookup('Mirror', self.mirror) - if mirror not in lsp.mirror_rules and not self.if_exist: + if mirror not in lsp.mirror_rules and not self.if_exists: msg = "Mirror Rule %s doesn't exist on LSP %s" % (self.mirror, self.port) raise RuntimeError(msg) diff --git a/ovsdbapp/schema/ovn_northbound/impl_idl.py b/ovsdbapp/schema/ovn_northbound/impl_idl.py index 27953075..3c018020 100644 --- a/ovsdbapp/schema/ovn_northbound/impl_idl.py +++ b/ovsdbapp/schema/ovn_northbound/impl_idl.py @@ -474,5 +474,5 @@ class OvnNbApiIdlImpl(ovs_idl.Backend, api.API): def lsp_attach_mirror(self, port, mirror, may_exist=False): return cmd.LspAttachMirror(self, port, mirror, may_exist) - def lsp_detach_mirror(self, port, mirror, if_exist=False): - return cmd.LspDetachMirror(self, port, mirror, if_exist) + def lsp_detach_mirror(self, port, mirror, if_exists=False): + return cmd.LspDetachMirror(self, port, mirror, if_exists) diff --git a/ovsdbapp/tests/functional/schema/ovn_northbound/test_impl_idl.py b/ovsdbapp/tests/functional/schema/ovn_northbound/test_impl_idl.py index 10ff9c0c..a389c6dc 100644 --- a/ovsdbapp/tests/functional/schema/ovn_northbound/test_impl_idl.py +++ b/ovsdbapp/tests/functional/schema/ovn_northbound/test_impl_idl.py @@ -3219,9 +3219,9 @@ class TestMirrorOps(OvnNorthboundTest): check_error=True ) - # detach with if_exist=True, and check the result, to be as previously + # detach with if_exists=True, and check the result, to be as previously self.api.lsp_detach_mirror( self.port_uuid, mirror2.uuid, - if_exist=True).execute(check_error=True) + if_exists=True).execute(check_error=True) self.assertEqual(1, len(port.mirror_rules)) self.assertEqual(mirror1.uuid, port.mirror_rules[0].uuid)