use pydantic v2

This commit is contained in:
Roy Olav Purser 2024-02-10 18:34:27 +01:00
parent d03c722517
commit e8d8e1f5be
Signed by: roypur
GPG Key ID: 063DAA01D56E28CB

View File

@ -31,7 +31,7 @@ def write_wg(config: Config):
def get_config() -> Optional[Config]:
with open("/snacks/wireguard/wg.json", "r", encoding="utf-8") as f:
config = Config.parse_raw(f.read())
config = Config.model_validate_json(f.read())
config.host = socket.gethostbyname(config.host)
return config