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

Method run_function

tests/support/case.py:849–872  ·  view source on GitHub ↗

We use a 180s timeout here, which some slower systems do end up needing

(
        self, function, arg=(), timeout=180, wipe=True, raw=False, **kwargs
    )

Source from the content-addressed store, hash-verified

847
848 # pylint: disable=arguments-differ
849 def run_function(
850 self, function, arg=(), timeout=180, wipe=True, raw=False, **kwargs
851 ):
852 """
853 We use a 180s timeout here, which some slower systems do end up needing
854 """
855 ret = self.run_ssh(
856 self._arg_str(function, arg), timeout=timeout, wipe=wipe, raw=raw, **kwargs
857 )
858 log.debug(
859 "SSHCase run_function executed %s with arg %s and kwargs %s",
860 function,
861 arg,
862 kwargs,
863 )
864 log.debug("SSHCase JSON return: %s", ret)
865
866 # Late import
867 import salt.utils.json
868
869 try:
870 return salt.utils.json.loads(ret)["localhost"]
871 except Exception: # pylint: disable=broad-except
872 return ret
873
874 # pylint: enable=arguments-differ
875 def custom_roster(self, new_roster, data):

Callers 4

wrapFunction · 0.45
make_repoMethod · 0.45
_pushMethod · 0.45
make_extra_repoMethod · 0.45

Calls 4

_arg_strMethod · 0.95
run_sshMethod · 0.80
debugMethod · 0.80
loadsMethod · 0.45

Tested by

no test coverage detected