Clarify comments around state tracking.

master
jowj 4 years ago
parent cb9dae54c9
commit 618b005da4

@ -99,10 +99,10 @@ while is_on:
else:
stateChanged = False
# old file removal must happen after state tracking:
# delete state.log so I can write to it cleanly
os.remove("/shared/state.log")
# queue up an alert if stateChanged = True
results = []
with open("/shared/results.json", "r") as json_File:
for line in json_File:
@ -114,7 +114,7 @@ while is_on:
errorText = key + " returned with status " + str(value) + "\n"
errorFile.write(errorText)
# track state
# Copy current results to state.log file for next iteration
errorFile = open("/shared/state.log", "a+")
errorFile.write(json_string)
errorFile.write(cert_json)

Loading…
Cancel
Save