Randomize order of installs and removals, to prevent a single hanging/crashing/etc. package from continually preventing others from being processed.

This commit is contained in:
Justin McWilliams
2013-12-03 10:32:34 -05:00
parent 4f67a5d50d
commit dcbfaa74bc

View File

@@ -23,7 +23,7 @@ munki module to automatically install pkgs, mpkgs, and dmgs
import datetime
import os
import pwd
#import signal
import random
import subprocess
import time
import stat
@@ -632,6 +632,7 @@ def installWithInfo(
restartflag = False
itemindex = 0
skipped_installs = []
random.shuffle(installlist)
for item in installlist:
# Keep track of when this particular install started.
utc_now = datetime.datetime.utcnow()
@@ -936,6 +937,7 @@ def processRemovals(removallist, only_unattended=False):
restartFlag = False
index = 0
skipped_removals = []
random.shuffle(removallist)
for item in removallist:
if only_unattended:
if not item.get('unattended_uninstall'):