'unattended_install' and 'force_install_after_date' actions for Apple update are honored. Overall, functions were add/modified to support this effort.

This commit is contained in:
Heig Gregorian
2013-02-15 18:34:28 -08:00
parent e59555ff76
commit cd3c69b5a2
4 changed files with 116 additions and 64 deletions
+7 -4
View File
@@ -207,11 +207,13 @@ def munkiUpdatesContainAppleItems():
def thereAreUpdatesToBeForcedSoon(hours=72):
'''Return True if any updates need to be installed within the next
X hours, false otherwise'''
installinfo = getInstallInfo()
installinfo = getInstallInfo().get('managed_installs', [])
installinfo.extend(getAppleUpdates().get('AppleUpdates', []))
if installinfo:
now = NSDate.date()
now_xhours = NSDate.dateWithTimeIntervalSinceNow_(hours * 3600)
for item in installinfo.get('managed_installs', []):
for item in installinfo:
force_install_after_date = item.get('force_install_after_date')
if force_install_after_date:
force_install_after_date = discardTimeZoneFromDate(
@@ -227,9 +229,10 @@ def earliestForceInstallDate():
"""
earliest_date = None
installinfo = getInstallInfo()
installinfo = getInstallInfo().get('managed_installs', [])
installinfo.extend(getAppleUpdates().get('AppleUpdates', []))
for install in installinfo.get('managed_installs', []):
for install in installinfo:
this_force_install_date = install.get('force_install_after_date')
if this_force_install_date: