|
|
@ -19,8 +19,6 @@ __metaclass__ = type
|
|
|
|
|
|
|
|
|
|
|
|
from ansible.plugins.action import ActionBase
|
|
|
|
from ansible.plugins.action import ActionBase
|
|
|
|
|
|
|
|
|
|
|
|
import re
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ActionModule(ActionBase):
|
|
|
|
class ActionModule(ActionBase):
|
|
|
|
TRANSFERS_FILES = False
|
|
|
|
TRANSFERS_FILES = False
|
|
|
@ -42,7 +40,6 @@ class ActionModule(ActionBase):
|
|
|
|
# for some modules (script, raw), the sudo success key
|
|
|
|
# for some modules (script, raw), the sudo success key
|
|
|
|
# may leak into the stdout due to the way the sudo/su
|
|
|
|
# may leak into the stdout due to the way the sudo/su
|
|
|
|
# command is constructed, so we filter that out here
|
|
|
|
# command is constructed, so we filter that out here
|
|
|
|
if result.get('stdout','').strip().startswith('BECOME-SUCCESS-'):
|
|
|
|
result['stdout'] = self._strip_success_message(result.get('stdout', ''))
|
|
|
|
result['stdout'] = re.sub(r'^((\r)?\n)?BECOME-SUCCESS.*(\r)?\n', '', result['stdout'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result
|
|
|
|
return result
|
|
|
|