mirror of
https://github.com/munki/munki.git
synced 2026-01-11 09:20:27 -06:00
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:
@@ -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'):
|
||||
|
||||
Reference in New Issue
Block a user