Commit 80a3a750 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Tests - Tools - Firewall Agent:

- Fix in rule skipper
parent bd69eba9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -43,9 +43,9 @@ class MalformedOutputException(Exception):
        )

class UnsupportedElementException(Exception):
    def __init__(self, element_type : str, value : str) -> None:
    def __init__(self, element : str, value : str) -> None:
        super().__init__(
            f'Unsupported: element_type={str(element_type)} value={str(value)}'
            f'Unsupported: element={str(element)} value={str(value)}'
        )

class MissingFieldException(Exception):
+2 −2
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ class Rule:
        rule : 'Rule' = cls(family, table, chain)

        if 'expr' not in entry: raise MissingFieldException('rule.expr', entry)
        expr_list : List[Dict] = entry.pop('expr')
        expr_list : List[Dict] = entry['expr']
        num_fields_updated = 0
        for expr_entry in expr_list:
            expr_entry_fields = set(expr_entry.keys())
@@ -67,7 +67,7 @@ class Rule:
            elif expr_entry_type in {'accept', 'drop', 'reject'}:
                rule.action = get_action_from_str(expr_entry_type)
                num_fields_updated += 1
            elif expr_entry_type in {'counter', 'jump'}:
            elif expr_entry_type in {'counter', 'jump', 'xt'}:
                pass # ignore these entry types
            else:
                raise UnsupportedElementException('expr_entry', expr_entry)