Fixed modules using Popen (#24558)

* Fixed modules using Popen

* Reverted change in mysql_db, Popen is required to pipe compressed archives to mysql
This commit is contained in:
Andrea Tartaglia 2017-06-22 13:22:34 +01:00 committed by Toshio Kuratomi
commit 921bc0599b
3 changed files with 8 additions and 21 deletions

View file

@ -104,12 +104,10 @@ RETURN = '''
...
'''
from subprocess import Popen, PIPE
from ansible.module_utils.basic import AnsibleModule, BOOLEANS_TRUE
from ansible.module_utils.pycompat24 import get_exception
class GConf2Preference(object):
def __init__(self, ansible, key, value_type, value,
direct=False, config_source=""):
@ -158,11 +156,7 @@ class GConf2Preference(object):
cmd += "--unset {0}".format(self.key)
# Start external command
process = Popen([cmd], stdout=PIPE, stderr=PIPE, shell=True)
# In either case, we will capture the output
out = process.stdout.read()
err = process.stderr.read()
rc, out, err = self.ansible.run_command(cmd, use_unsafe_shell=True)
if len(err) > 0:
if fail_onerr: