Get more useful output from stateful commands

This fixes #23709

Signed-off-by: Mathieu Le Marec - Pasquet <kiorky@cryptelium.net>
This commit is contained in:
Mathieu Le Marec - Pasquet 2015-05-14 15:59:19 +02:00
parent be7c7ef3fd
commit c70690969e

View file

@ -229,11 +229,13 @@ def _reinterpreted_state(state):
key, val = item.split('=')
data[key] = val
except ValueError:
return _failout(
state = _failout(
state,
'Failed parsing script output! '
'Stdout must be JSON or a line of name=value pairs.'
)
state['changes'].update(ret)
return state
changed = _is_true(data.get('changed', 'no'))