Skip to content
Permalink
Browse files

Log shut down actions no matter the logging level; don't require halt…

… message to be at the beginning of a softwareupdate output line
  • Loading branch information...
gregneagle committed Dec 18, 2018
1 parent 51fa1dc commit 91dbacb6366b0f71c0ce3000e3cf7a075dba78a5
Showing with 9 additions and 4 deletions.
  1. +4 −1 code/client/managedsoftwareupdate
  2. +5 −3 code/client/munkilib/appleupdates/au.py
@@ -330,7 +330,10 @@ def startLogoutHelper():
def doRestart(shutdown=False):
"""Handle the need for a restart or a possbile shutdown."""
restartMessage = 'Software installed or removed requires a restart.'
munkilog.log(restartMessage)
if shutdown:
munkilog.log('Software installed or removed requires a shut down.')
else:
munkilog.log(restartMessage)
if display.munkistatusoutput:
munkistatus.hideStopButton()
munkistatus.message(restartMessage)
@@ -658,10 +658,10 @@ def _run_softwareupdate(
pass
elif output == '':
pass
elif output.startswith('Please call halt'):
elif output.contains('Please call halt'):
# This update requires we shutdown instead of a restart.
display.display_status_minor(output)
display.display_debug2('This update requires a shutdown...')
display.display_info('### This update requires a shutdown. ###')
self.shutdown_instead_of_restart = True
else:
display.display_status_minor(output)
@@ -856,7 +856,9 @@ def install_apple_updates(self, only_unattended=False):
munkistatus.showStopButton()

if self.shutdown_instead_of_restart:
display.display_debug2('Found shutdown flag...')
display.display_info(
'One or more Apple updates requires a shutdown instead of '
'restart.')
restart_action = POSTACTION_SHUTDOWN

return restart_action

0 comments on commit 91dbacb

Please sign in to comment.
You can’t perform that action at this time.