Return a reference to the subprocess so output can be handled from elsewhere.
This commit is contained in:
parent
58c1146387
commit
0b2eb3b1be
1 changed files with 5 additions and 0 deletions
|
@ -235,6 +235,11 @@ class Terraform(object):
|
||||||
|
|
||||||
p = subprocess.Popen(cmd_string, stdout=stdout, stderr=stderr, shell=True,
|
p = subprocess.Popen(cmd_string, stdout=stdout, stderr=stderr, shell=True,
|
||||||
cwd=working_folder, env=environ_vars)
|
cwd=working_folder, env=environ_vars)
|
||||||
|
|
||||||
|
synchronous = kwargs.pop('synchronous', True)
|
||||||
|
if not synchronous:
|
||||||
|
return p, None, None
|
||||||
|
|
||||||
out, err = p.communicate()
|
out, err = p.communicate()
|
||||||
ret_code = p.returncode
|
ret_code = p.returncode
|
||||||
log.debug('output: {o}'.format(o=out))
|
log.debug('output: {o}'.format(o=out))
|
||||||
|
|
Loading…
Reference in a new issue