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,
)
| 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 | """ |