From a65846dfc40b05218318733a17e8202008135818 Mon Sep 17 00:00:00 2001 From: Shea Craig Date: Thu, 21 Sep 2023 14:19:58 -0400 Subject: [PATCH] Anticipate a None result and ignore (and skip setting last_check --- payload/usr/local/sal/checkin_modules/apple_sus_checkin.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/payload/usr/local/sal/checkin_modules/apple_sus_checkin.py b/payload/usr/local/sal/checkin_modules/apple_sus_checkin.py index ab350b2..91b6d51 100755 --- a/payload/usr/local/sal/checkin_modules/apple_sus_checkin.py +++ b/payload/usr/local/sal/checkin_modules/apple_sus_checkin.py @@ -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