MCPcopy Create free account
hub / github.com/saltstack/salt / script_retcode

Function script_retcode

salt/modules/cmdmod.py:3223–3434  ·  view source on GitHub ↗

Download a script from a remote location and execute the script locally. The script can be located on the salt master file server or on an HTTP/FTP server. The script will be executed directly, so it can be written in any available programming language. The script can also

(
    source,
    args=None,
    cwd=None,
    stdin=None,
    runas=None,
    group=None,
    shell=DEFAULT_SHELL,
    python_shell=None,
    env=None,
    template="jinja",
    umask=None,
    timeout=None,
    reset_system_locale=True,
    saltenv=None,
    output_encoding=None,
    output_loglevel="debug",
    log_callback=None,
    use_vt=False,
    password=None,
    success_retcodes=None,
    success_stdout=None,
    success_stderr=None,
    **kwargs,
)

Source from the content-addressed store, hash-verified

3221
3222
3223def script_retcode(
3224 source,
3225 args=None,
3226 cwd=None,
3227 stdin=None,
3228 runas=None,
3229 group=None,
3230 shell=DEFAULT_SHELL,
3231 python_shell=None,
3232 env=None,
3233 template="jinja",
3234 umask=None,
3235 timeout=None,
3236 reset_system_locale=True,
3237 saltenv=None,
3238 output_encoding=None,
3239 output_loglevel="debug",
3240 log_callback=None,
3241 use_vt=False,
3242 password=None,
3243 success_retcodes=None,
3244 success_stdout=None,
3245 success_stderr=None,
3246 **kwargs,
3247):
3248 """
3249 Download a script from a remote location and execute the script locally.
3250 The script can be located on the salt master file server or on an HTTP/FTP
3251 server.
3252
3253 The script will be executed directly, so it can be written in any available
3254 programming language.
3255
3256 The script can also be formatted as a template, the default is jinja.
3257
3258 Only evaluate the script return code and do not block for terminal output
3259
3260 :param str source: The location of the script to download. If the file is
3261 located on the master in the directory named spam, and is called eggs,
3262 the source string is salt://spam/eggs
3263
3264 :param str args: String of command line args to pass to the script. Only
3265 used if no args are specified as part of the `name` argument. To pass a
3266 string containing spaces in YAML, you will need to doubly-quote it:
3267 "arg1 'arg two' arg3"
3268
3269 :param str cwd: The directory from which to execute the command. Defaults
3270 to the home directory of the user specified by ``runas`` (or the user
3271 under which Salt is running if ``runas`` is not specified).
3272
3273 :param str stdin: A string of standard input can be specified for the
3274 command to be run using the ``stdin`` parameter. This can be useful in
3275 cases where sensitive information must be read from standard input.
3276
3277 :param str runas: Specify an alternate user to run the command. The default
3278 behavior is to run as the user under which Salt is running.
3279
3280 :param str password: Windows only. The password for the account specified

Callers

nothing calls this directly

Calls 2

scriptFunction · 0.70
popMethod · 0.45

Tested by

no test coverage detected