mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 11:10:21 -07:00
Standardize removal of BECOME-SUCCESS method and use it for async too
Fixes #13965 Fixes #13971
This commit is contained in:
parent
61009604e3
commit
54cde0d082
3 changed files with 14 additions and 4 deletions
|
@ -24,6 +24,7 @@ import json
|
|||
import os
|
||||
import pipes
|
||||
import random
|
||||
import re
|
||||
import stat
|
||||
import tempfile
|
||||
import time
|
||||
|
@ -356,6 +357,14 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
|||
|
||||
return data[idx:]
|
||||
|
||||
def _strip_success_message(self, data):
|
||||
'''
|
||||
Removes the BECOME-SUCCESS message from the data.
|
||||
'''
|
||||
if data.strip().startswith('BECOME-SUCCESS-'):
|
||||
data = re.sub(r'^((\r)?\n)?BECOME-SUCCESS.*(\r)?\n', '', data)
|
||||
return data
|
||||
|
||||
def _execute_module(self, module_name=None, module_args=None, tmp=None, task_vars=None, persist_files=False, delete_remote_tmp=True):
|
||||
'''
|
||||
Transfer and run a module along with its arguments.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue