mirror of
https://github.com/munki/munki.git
synced 2026-04-23 21:40:25 -05:00
Use munkicommon.log() to log Python tracebacks in cases where exceptions are reraised causing Munki to crash and print the same traceback to stderr. Otherwise, the tracebacks are displayed to users twice when running from the commandline.
This commit is contained in:
@@ -226,7 +226,7 @@ def doInstallTasks(only_unattended=False):
|
||||
except:
|
||||
munkicommon.display_error(
|
||||
'Unexpected error in munkilib.installer:')
|
||||
munkicommon.display_error(traceback.format_exc())
|
||||
munkicommon.log(traceback.format_exc())
|
||||
munkicommon.savereport()
|
||||
raise
|
||||
|
||||
@@ -243,7 +243,7 @@ def doInstallTasks(only_unattended=False):
|
||||
except:
|
||||
munkicommon.display_error(
|
||||
'Unexpected error in appleupdates.installAppleUpdates:')
|
||||
munkicommon.display_error(traceback.format_exc())
|
||||
munkicommon.log(traceback.format_exc())
|
||||
munkicommon.savereport()
|
||||
raise
|
||||
|
||||
@@ -648,7 +648,7 @@ def main():
|
||||
updatecheckresult = updatecheck.check(client_id=options.id)
|
||||
except:
|
||||
munkicommon.display_error('Unexpected error in updatecheck:')
|
||||
munkicommon.display_error(traceback.format_exc())
|
||||
munkicommon.log(traceback.format_exc())
|
||||
munkicommon.savereport()
|
||||
raise
|
||||
|
||||
@@ -672,7 +672,7 @@ def main():
|
||||
applesoftwareupdatesonly)))
|
||||
except:
|
||||
munkicommon.display_error('Unexpected error in appleupdates:')
|
||||
munkicommon.display_error(traceback.format_exc())
|
||||
munkicommon.log(traceback.format_exc())
|
||||
munkicommon.savereport()
|
||||
raise
|
||||
|
||||
@@ -687,7 +687,7 @@ def main():
|
||||
appleupdates.appleSoftwareUpdatesAvailable(suppresscheck=True)
|
||||
except:
|
||||
munkicommon.display_error('Unexpected error in appleupdates:')
|
||||
munkicommon.display_error(traceback.format_exc())
|
||||
munkicommon.log(traceback.format_exc())
|
||||
munkicommon.savereport()
|
||||
raise
|
||||
|
||||
|
||||
Reference in New Issue
Block a user