From 7eef3b35714b77641e98d47666aa0cc3030f0586 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Thu, 19 Oct 2017 10:39:11 -0700 Subject: [PATCH] Adding a copy.deepcopy to the for loop that looks for old jobs to avoid stale jobs ending up in the list. --- salt/utils/schedule.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/salt/utils/schedule.py b/salt/utils/schedule.py index 5b182d1c80..ea6628427e 100644 --- a/salt/utils/schedule.py +++ b/salt/utils/schedule.py @@ -1139,7 +1139,8 @@ class Schedule(object): # Sort the list of "whens" from earlier to later schedules _when.sort() - for i in _when: + # Copy the list so we can loop through it + for i in copy.deepcopy(_when): if i < now and len(_when) > 1: # Remove all missed schedules except the latest one. # We need it to detect if it was triggered previously.