1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

strip BECOME-SUCCESS at lower level

Fixes #14395
This commit is contained in:
Matthew Stoltenberg 2016-02-09 09:18:09 -07:00 committed by James Cammarata
parent 162dd2594f
commit d36394d6a6
4 changed files with 3 additions and 11 deletions

View file

@ -544,8 +544,10 @@ class ActionBase(with_metaclass(ABCMeta, object)):
if rc is None:
rc = 0
display.debug("_low_level_execute_command() done: rc=%d, stdout=%s, stderr=%s" % (rc, stdout, stderr))
# be sure to remove the BECOME-SUCCESS message now
out = self._strip_success_message(out)
display.debug("_low_level_execute_command() done: rc=%d, stdout=%s, stderr=%s" % (rc, stdout, stderr))
return dict(rc=rc, stdout=out, stdout_lines=out.splitlines(), stderr=err)
def _get_first_available_file(self, faf, of=None, searchdir='files'):

View file

@ -75,8 +75,4 @@ class ActionModule(ActionBase):
result['changed'] = True
# be sure to strip out the BECOME-SUCCESS message, which may
# be there depending on the output of the module
result['stdout'] = self._strip_success_message(result.get('stdout', ''))
return result

View file

@ -37,9 +37,4 @@ class ActionModule(ActionBase):
executable = self._task.args.get('executable')
result.update(self._low_level_execute_command(self._task.args.get('_raw_params'), executable=executable))
# for some modules (script, raw), the sudo success key
# may leak into the stdout due to the way the sudo/su
# command is constructed, so we filter that out here
result['stdout'] = self._strip_success_message(result.get('stdout', ''))
return result

View file

@ -97,7 +97,6 @@ class ActionModule(ActionBase):
if tmp and "tmp" in tmp and not C.DEFAULT_KEEP_REMOTE_FILES:
self._remove_tmp_path(tmp)
result['stdout'] = self._strip_success_message(result.get('stdout', ''))
result['changed'] = True
return result