Skip to content

Commit d3fe394

Browse files
committed
addressing review comments
1 parent fa79547 commit d3fe394

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cloudflare-ddns.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,10 @@ def updateIPs(ips):
263263
config = None
264264
try:
265265
with open(os.path.join(CONFIG_PATH, "config.json")) as config_file:
266-
config = json.loads(Template(config_file.read()).safe_substitute(ENV_VARS))
266+
if len(ENV_VARS) != 0:
267+
config = json.loads(Template(config_file.read()).safe_substitute(ENV_VARS))
268+
else:
269+
config = json.loads(config_file.read())
267270
except:
268271
print("😡 Error reading config.json")
269272
# wait 10 seconds to prevent excessive logging on docker auto restart
@@ -313,4 +316,4 @@ def updateIPs(ips):
313316
print("❓ Unrecognized parameter '" +
314317
sys.argv[1] + "'. Stopping now.")
315318
else:
316-
updateIPs(getIPs())
319+
updateIPs(getIPs())

0 commit comments

Comments
 (0)