wrappers to salt shell commands

This is not included in a salt module and isolated to be picklable and used thorough python multiprocessing as a target

The module has redundant functions with the makina-states codebase but the goal is that it is selfcontained and dependency less.

mc_states.saltcaller.complex_json_output_multilines(string)

Extract json output from stdout (lines parse variant)

if states garbled the stdout, but we still have a result like:

...command gargage output...
{"local": true}

we will try to remove the starting output and so extract the result from the output

mc_states.saltcaller.complex_json_output_simple(string)

Extract json output from stdout (string parse variant)

if states garbled the stdout, but we still have a result like:

...command gargage output...
{"local": true}

we will try to remove the starting output and so extract the result from the output

mc_states.saltcaller.format_error(ret)

To avoid large memory usage, only lazy format errors on demand

mc_states.saltcaller.format_output(ret)

To avoid large memory usage, only lazy format errors on demand

mc_states.saltcaller.format_output_and_error(ret)

To avoid large memory usage, only lazy format errors on demand

mc_states.saltcaller.magicstring(thestr)

Convert any string to UTF-8 ENCODED one