When skipping Apple Software updates because there is an update from Apple in InstallInfo.plist, remove AppleUpdates.plist to prevent MSU.app and logouthelper from presenting force_install_after_date warnings for items it will not be able to install because Munki updates are blocking Apple updates.

This commit is contained in:
Greg Neagle
2013-03-08 13:52:01 -08:00
parent f8f558edc5
commit a21a4b1acc

View File

@@ -692,6 +692,18 @@ def main():
# shouldn't run Software Update if we're doing Apple items
# with Munki items
should_do_apple_updates = False
# if there are force_install_after_date items in a pre-existing
# AppleUpdates.plist this means we are blocking those updates.
# we need to delete AppleUpdates.plist so that other code doesn't
# mistakenly alert for forced installs it isn't actually going to
# install.
appleupdates_plist = os.path.join(
munkicommon.pref('ManagedInstallDir'), 'AppleUpdates.plist')
try:
os.unlink(appleupdates_plist)
except OSError:
pass
else:
# check the normal preferences
should_do_apple_updates = munkicommon.pref(
@@ -812,7 +824,8 @@ def main():
appleupdates.appleSoftwareUpdatesAvailable(
suppresscheck=True, client_id=options.id)
except:
munkicommon.display_error('Unexpected error in appleupdates:')
munkicommon.display_error(
'Unexpected error in appleupdates:')
munkicommon.log(traceback.format_exc())
munkicommon.savereport()
raise