From c7fc0df7fb6304d4df08cfe2773cc416f76cad00 Mon Sep 17 00:00:00 2001 From: jeanluc Date: Tue, 11 Oct 2022 09:37:38 +0200 Subject: [PATCH] Fix master scheduler with when param --- changelog/62858.fixed | 1 + salt/utils/schedule.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelog/62858.fixed diff --git a/changelog/62858.fixed b/changelog/62858.fixed new file mode 100644 index 00000000000..bae029fc895 --- /dev/null +++ b/changelog/62858.fixed @@ -0,0 +1 @@ +Fixed master job scheduler using when diff --git a/salt/utils/schedule.py b/salt/utils/schedule.py index 5f461a47a6c..5e58cd452c8 100644 --- a/salt/utils/schedule.py +++ b/salt/utils/schedule.py @@ -1064,7 +1064,9 @@ class Schedule: return when_ = self.opts["pillar"]["whens"][i] elif ( - "whens" in self.opts["grains"] and i in self.opts["grains"]["whens"] + "grains" in self.opts + and "whens" in self.opts["grains"] + and i in self.opts["grains"]["whens"] ): if not isinstance(self.opts["grains"]["whens"], dict): data[