MCPcopy Index your code
hub / github.com/saltstack/salt / run_function

Method run_function

tests/support/case.py:279–300  ·  view source on GitHub ↗

Execute function with salt-call. This function is added for compatibility with ModuleCase. This makes it possible to use decorators like @with_system_user.

(
        self,
        function,
        arg=(),
        with_retcode=False,
        catch_stderr=False,
        local=False,
        timeout=RUN_TIMEOUT,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

277 return ret
278
279 def run_function(
280 self,
281 function,
282 arg=(),
283 with_retcode=False,
284 catch_stderr=False,
285 local=False,
286 timeout=RUN_TIMEOUT,
287 **kwargs,
288 ):
289 """
290 Execute function with salt-call.
291
292 This function is added for compatibility with ModuleCase. This makes it possible to use
293 decorators like @with_system_user.
294 """
295 arg_str = "{} {} {}".format(
296 function,
297 " ".join(str(arg_) for arg_ in arg),
298 " ".join("{}={}".format(*item) for item in kwargs.items()),
299 )
300 return self.run_call(arg_str, with_retcode, catch_stderr, local, timeout)
301
302 def run_cloud(self, arg_str, catch_stderr=False, timeout=None, config_dir=None):
303 """

Callers

nothing calls this directly

Calls 3

run_callMethod · 0.95
formatMethod · 0.80
itemsMethod · 0.45

Tested by

no test coverage detected