diff --git a/roles/bird/filter_plugins/bird.py b/roles/bird/filter_plugins/bird.py index 2cf01de..5bfae8f 100644 --- a/roles/bird/filter_plugins/bird.py +++ b/roles/bird/filter_plugins/bird.py @@ -99,7 +99,7 @@ class IPFlag(str): pattern = r"(?P.*?)(?P[+-]|\{[0-9]+,[0-9]+\})?$" parts = re.match(pattern, v) - return (ip_network(parts.group("ip")), parts.group("flag")) + return (ip_network(parts.group("ip")), parts.group("flag") or "") class NetMatch(BaseModel): @@ -245,7 +245,7 @@ def str_of_condition(condition: Condition, ctx: bool) -> str: m for m in matches if isinstance(m[0], IPv6Network) ] - return f"net ~ [ {', '.join([f'{network}{str(flag)}' for (network, flag) in networks])} ]" + return f"net ~ [ {', '.join([f'{network}{flag}' for (network, flag) in networks])} ]" def lines_of_action(action: Action, ctx: Context) -> Iterable[str]: