If there are GUI users and we have forced_* items, recheck munkiUpdatesAvailable() before trying to notifiy the user so we don't notify if we have nothing left to do.

git-svn-id: http://munki.googlecode.com/svn/trunk@818 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
Greg Neagle
2010-10-19 04:00:57 +00:00
parent 27a4aafbc8
commit e2ca3f8c78
+14 -11
View File
@@ -618,17 +618,20 @@ def main():
'SuppressAutoInstall is true.')
else: # there are GUI users
doInstallTasks(only_forced=True)
consoleuser = munkicommon.getconsoleuser()
if consoleuser == u'loginwindow':
# someone is logged in, but we're sitting at
# the loginwindow due to fast user switching
# so do nothing
pass
elif not munkicommon.pref('SuppressUserNotification'):
notifyUserOfUpdates()
else:
munkicommon.log('Skipping user notification because '
'SuppressUserNotification is true.')
# it's possible that we no longer have any available updates
# so we need to check InstallInfo.plist again
if munkiUpdatesAvailable():
consoleuser = munkicommon.getconsoleuser()
if consoleuser == u'loginwindow':
# someone is logged in, but we're sitting at
# the loginwindow due to fast user switching
# so do nothing
pass
elif not munkicommon.pref('SuppressUserNotification'):
notifyUserOfUpdates()
else:
munkicommon.log('Skipping user notification because '
'SuppressUserNotification is true.')
elif not options.quiet:
print ('\nRun %s --installonly to install the downloaded '