Add support for new preferences "SuppressUserNotification" and "SuppressAutoInstall".

SuppressUserNotification prevents munki from notifying a logged-in user of available updates.

SuppressAutoInstall prevents munki from automatically installing when at the loginwindow.

git-svn-id: http://munki.googlecode.com/svn/trunk@606 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
Greg Neagle
2010-07-27 16:47:36 +00:00
parent 4ca006dc99
commit bdd0f8e603
2 changed files with 12 additions and 4 deletions
+10 -3
View File
@@ -549,8 +549,12 @@ def main():
if not munkicommon.currentGUIusers():
# no GUI users
if getIdleSeconds() > 10:
# no GUI users, system is idle, so install
mustrestart = doInstallTasks()
if not munkicommon.pref('SuppressAutoInstall'):
# no GUI users, system is idle, so install
mustrestart = doInstallTasks()
else:
munkicommon.log("Skipping auto install because "
"SuppressAutoInstall is true.")
else:
# there are GUI users
consoleuser = munkicommon.getconsoleuser()
@@ -559,9 +563,12 @@ def main():
# the loginwindow due to fast user switching
# so do nothing
pass
else:
elif munkicommon.pref('SuppressUserNotification'):
# notify the current console user
notifyUserOfUpdates()
else:
munkicommon.log("Skipping user notification because "
"SuppressUserNotification is true.")
elif not options.quiet:
print ("\nRun %s --installonly to install the downloaded "
"updates." % myname)
+2 -1
View File
@@ -501,8 +501,9 @@ def prefs():
_prefs['SoftwareUpdateServerURL'] = ''
_prefs['DaysBetweenNotifications'] = 1
_prefs['LastNotifiedDate'] = '1970-01-01 00:00:00 -0000'
# Added by bcw
_prefs['UseClientCertificate'] = False
_prefs['SuppressUserNotification'] = False
_prefs['SuppressAutoInstall'] = False
prefsfile = "/Library/Preferences/ManagedInstalls.plist"
pl = {}