From a21a4b1acc5dfffd83a5b8acaaea1d75c22cd32d Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Fri, 8 Mar 2013 13:52:01 -0800 Subject: [PATCH] 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. --- code/client/managedsoftwareupdate | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/code/client/managedsoftwareupdate b/code/client/managedsoftwareupdate index bc480158..702fb13b 100755 --- a/code/client/managedsoftwareupdate +++ b/code/client/managedsoftwareupdate @@ -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