chore(bird): Fix None flag
This commit is contained in:
parent
ba033f9099
commit
54d227232b
1 changed files with 2 additions and 2 deletions
|
@ -99,7 +99,7 @@ class IPFlag(str):
|
||||||
pattern = r"(?P<ip>.*?)(?P<flag>[+-]|\{[0-9]+,[0-9]+\})?$"
|
pattern = r"(?P<ip>.*?)(?P<flag>[+-]|\{[0-9]+,[0-9]+\})?$"
|
||||||
parts = re.match(pattern, v)
|
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):
|
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)
|
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]:
|
def lines_of_action(action: Action, ctx: Context) -> Iterable[str]:
|
||||||
|
|
Loading…
Reference in a new issue