in cont_to_dict if replaced by get

This commit is contained in:
Désiré Werner Menrath 2025-04-19 19:29:46 +02:00
parent ea750b0cfc
commit 2a995eabd5
2 changed files with 5 additions and 4 deletions

View File

@ -293,10 +293,11 @@ class Tunnel:
if "," in dns: if "," in dns:
dns = dns[:-1] dns = dns[:-1]
endpoint = final_dict["Endpoint"] endpoint = final_dict["Endpoint"]
if "PresharedKey" in final_dict: try:
pre_key = final_dict["PresharedKey"] pre_key = final_dict.get("PresharedKey")
else: pre_key = final_dict.get("PreSharedKey")
pre_key = final_dict["PreSharedKey"] finally:
pass
return address, dns, endpoint, pre_key return address, dns, endpoint, pre_key
@staticmethod @staticmethod