Skip to content

Commit

Permalink
Anticipate a None result and ignore (and skip setting last_check
Browse files Browse the repository at this point in the history
  • Loading branch information
sheagcraig committed Sep 21, 2023
1 parent af715df commit a65846d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions payload/usr/local/sal/checkin_modules/apple_sus_checkin.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,14 @@ def get_sus_facts():
install_log = handle.readlines()

for line in reversed(install_log):
# TODO: Stop if we go before the subprocess call datetime-wise
if "Catalog: http" in line and "catalog" not in result:
result["catalog"] = line.split()[-1]
elif "SUScan: Elapsed scan time = " in line and "last_check" not in result:
result["last_check"] = _get_log_time(line).isoformat()
try:
result["last_check"] = _get_log_time(line).isoformat()
except AttributeError:
# _get_log_time returned None
pass

if (log_time := _get_log_time(line)) and log_time < history_limit:
# Let's not look earlier than when we started
Expand Down

0 comments on commit a65846d

Please sign in to comment.