Content-Length: 293903 | pFad | http://github.com/saltstack/salt/commit/0e775dadfb81e995d198153b05e94ef2d4a4f880

6B Ensure "test" returns only boolean values · saltstack/salt@0e775da · GitHub
Skip to content

Commit 0e775da

Browse files
committed
Ensure "test" returns only boolean values
1 parent 39953b7 commit 0e775da

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

salt/loader/lazy.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ def __call__(self, *args, **kwargs):
153153
if hasattr(mod, "__opts__"):
154154
if not isinstance(mod.__opts__, salt.loader.context.NamedLoaderContext):
155155
if "test" in self.loader.opts:
156-
mod.__opts__["test"] = self.loader.opts["test"]
156+
if self.loader.opts["test"] is False:
157+
mod.__opts__["test"] = False
158+
else:
159+
mod.__opts__["test"] = True
157160
set_test = True
158161
if self.loader.inject_globals:
159162
run_func = global_injector_decorator(self.loader.inject_globals)(run_func)
@@ -190,7 +193,10 @@ async def __call__(
190193
if hasattr(mod, "__opts__"):
191194
if not isinstance(mod.__opts__, salt.loader.context.NamedLoaderContext):
192195
if "test" in self.loader.opts:
193-
mod.__opts__["test"] = self.loader.opts["test"]
196+
if self.loader.opts["test"] is False:
197+
mod.__opts__["test"] = False
198+
else:
199+
mod.__opts__["test"] = True
194200
set_test = True
195201
if self.loader.inject_globals:
196202
run_func = global_injector_decorator(self.loader.inject_globals)(run_func)

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/saltstack/salt/commit/0e775dadfb81e995d198153b05e94ef2d4a4f880

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy