diff --git a/states/_modules/syncthing.py b/states/_modules/syncthing.py index 748838a..2769406 100644 --- a/states/_modules/syncthing.py +++ b/states/_modules/syncthing.py @@ -30,7 +30,11 @@ def get_apikey(configfile="/root/.config/syncthing/config.xml"): return None -def get_config(url="http://localhost:8384", verify=False, apikey=get_apikey()): +def get_config(url="http://localhost:8384", verify=False, apikey=""): + try: + apikey=get_apikey() + except: + return None fullurl = f"{url}/rest/config" req = Request(method="GET", url=fullurl)