vpn: raise a clear error when no WireGuard config is configured
This commit is contained in:
@@ -62,7 +62,13 @@ def iface_name(cfg) -> str:
|
|||||||
|
|
||||||
|
|
||||||
def conf_path(cfg) -> Path:
|
def conf_path(cfg) -> Path:
|
||||||
return Path(cfg.vpn_wireguard).expanduser()
|
wg = getattr(cfg, "vpn_wireguard", None)
|
||||||
|
if not wg:
|
||||||
|
raise RuntimeError(
|
||||||
|
"no WireGuard config configured: set [vpn] wireguard in the config "
|
||||||
|
"(run 'yt-downloader init' and edit the file)"
|
||||||
|
)
|
||||||
|
return Path(wg).expanduser()
|
||||||
|
|
||||||
|
|
||||||
def _host_link(iface: str) -> str:
|
def _host_link(iface: str) -> str:
|
||||||
|
|||||||
Reference in New Issue
Block a user