Skip to content

Commit

Permalink
Merge pull request #68 from freifunkMUC/fix_domain_switch
Browse files Browse the repository at this point in the history
Replace or create existing route
  • Loading branch information
awlx authored Sep 11, 2021
2 parents 7563827 + 3ec0260 commit 62b8608
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion wgkex.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ mqtt:
keepalive: 5
tls: False
domain_prefix: myprefix-
log_level: DEBUG
logging_config:
formatters:
standard:
Expand Down
2 changes: 1 addition & 1 deletion wgkex/common/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}


def fetch_logging_configuration() -> dict[str, str]:
def fetch_logging_configuration():
"""Fetches logging configuration from disk, if exists.
If the config exists, then we check to see if the key 'logging_config' is set. If it is, we return this configuration.
Expand Down
2 changes: 0 additions & 2 deletions wgkex/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ class Config:
domains: List[str]
mqtt: MQTT
domain_prefix: str
log_level: str

@classmethod
def from_dict(cls, cfg: Dict[str, str]) -> "Config":
Expand All @@ -81,7 +80,6 @@ def from_dict(cls, cfg: Dict[str, str]) -> "Config":
domains=cfg["domains"],
mqtt=mqtt_cfg,
domain_prefix=cfg["domain_prefix"],
log_level=cfg["log_level"],
)


Expand Down
2 changes: 1 addition & 1 deletion wgkex/worker/netlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def route_handler(client: WireGuardClient) -> Dict:
# TODO(ruairi): Splice this into an add_ and remove_ function.
with pyroute2.IPRoute() as ip:
return ip.route(
"del" if client.remove else "add",
"del" if client.remove else "replace",
dst=client.lladdr,
oif=ip.link_lookup(ifname=client.wg_interface)[0],
)
Expand Down

0 comments on commit 62b8608

Please sign in to comment.