From 0ac6fbd3b6a21347589f0a9b5eb53ea3b5e83a08 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Tue, 14 Apr 2020 17:11:09 -0700 Subject: [PATCH] Don't check AppleUpdates.plist for forced updates if neither InstallAppleSoftwareUpdates or AppleSoftwareUpdatesOnly preferences are true --- code/client/munkilib/installinfo.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/code/client/munkilib/installinfo.py b/code/client/munkilib/installinfo.py index 9ff8261b..b4d75e7f 100644 --- a/code/client/munkilib/installinfo.py +++ b/code/client/munkilib/installinfo.py @@ -43,7 +43,7 @@ try: _ = xrange # pylint: disable=xrange-builtin except NameError: # no xrange in Python 3 - xrange = range + xrange = range # pylint: disable=redefined-builtin,invalid-name # This many hours before a force install deadline, start notifying the user. @@ -239,10 +239,11 @@ def force_install_package_check(): managed_install_dir = prefs.pref('ManagedInstallDir') - installinfo_types = { - 'InstallInfo.plist' : 'managed_installs', - 'AppleUpdates.plist': 'AppleUpdates' - } + installinfo_types = {'InstallInfo.plist': 'managed_installs'} + if (prefs.pref('InstallAppleSoftwareUpdates') or + prefs.pref('AppleSoftwareUpdatesOnly')): + # only consider Apple updates if the prefs say it's OK + installinfo_types['AppleUpdates.plist'] = 'AppleUpdates' now = NSDate.date() now_xhours = NSDate.dateWithTimeIntervalSinceNow_(