mirror of
https://github.com/munki/munki.git
synced 2026-04-22 20:48:36 -05:00
Don't log repetitive lines when running softwareupdate; only log if the stdout
has changed since the last loop iteration. This should change things like: Nov 16 13:12:03 Registering updated applications… ... Nov 16 13:12:19 Registering updated applications… Nov 16 13:12:19 Registering updated applications… Nov 16 13:12:20 Registering updated applications… Nov 16 13:12:20 Registering updated applications… Nov 16 13:12:21 Registering updated applications… Nov 16 13:12:21 Registering updated applications… Nov 16 13:12:22 Registering updated applications… Nov 16 13:12:22 Writing package receipts… Nov 16 13:12:23 Writing package receipts… Nov 16 13:12:23 Writing package receipts… Nov 16 13:12:24 Writing package receipts… Nov 16 13:12:24 Writing package receipts… Nov 16 13:12:25 Writing package receipts… Nov 16 13:12:25 Writing package receipts… ... Nov 16 13:12:59 Writing package receipts… To simply: Nov 16 13:12:03 Registering updated applications… Nov 16 13:12:22 Writing package receipts…
This commit is contained in:
@@ -880,6 +880,7 @@ class AppleUpdates(object):
|
||||
results['installed'] = []
|
||||
results['download'] = []
|
||||
|
||||
last_output = None
|
||||
while True:
|
||||
if stop_allowed and munkicommon.stopRequested():
|
||||
job.stop()
|
||||
@@ -895,6 +896,12 @@ class AppleUpdates(object):
|
||||
time.sleep(1)
|
||||
continue
|
||||
|
||||
# Don't bother parsing the stdout output if it hasn't changed since
|
||||
# the last loop iteration.
|
||||
if last_output == output:
|
||||
continue
|
||||
last_output = output
|
||||
|
||||
output = output.decode('UTF-8').strip()
|
||||
# send the output to STDOUT or MunkiStatus as applicable
|
||||
if output.startswith('Progress: '):
|
||||
|
||||
Reference in New Issue
Block a user