From 4bed314b0ae80d0f0e6fa1835c13cb160e25c4b3 Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Fri, 17 Jun 2022 17:56:47 -0400 Subject: [PATCH] authorizaton: fix static type checks Signed-off-by: Eric Callahan --- moonraker/components/authorization.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/moonraker/components/authorization.py b/moonraker/components/authorization.py index 27d7336..793d81c 100644 --- a/moonraker/components/authorization.py +++ b/moonraker/components/authorization.py @@ -172,7 +172,6 @@ class Authorization: self.trusted_domains: List[str] = [] for val in config.getlist('trusted_clients', []): # Check IP address - tc: Union[IPAddr, IPNetwork] try: tc = ipaddress.ip_address(val) except ValueError: @@ -182,7 +181,7 @@ class Authorization: continue # Check ip network try: - tc = ipaddress.ip_network(val) + tn = ipaddress.ip_network(val) except ValueError as e: if "has host bits set" in str(e): self.server.add_warning( @@ -191,7 +190,7 @@ class Authorization: continue pass else: - self.trusted_ranges.append(tc) + self.trusted_ranges.append(tn) continue # Check hostname match = re.match(r"([a-z0-9]+(-[a-z0-9]+)*\.?)+[a-z]{2,}$", val)