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[