Merge pull request #18 from raquel-ucl/asynch

Return access to the subprocess so output can be handled as desired
This commit is contained in:
beelit94 2018-03-19 18:28:40 -07:00 committed by GitHub
commit e2b7bd4686
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -290,6 +290,11 @@ class Terraform(object):
p = subprocess.Popen(cmds, stdout=stdout, stderr=stderr,
cwd=working_folder, env=environ_vars)
synchronous = kwargs.pop('synchronous', True)
if not synchronous:
return p, None, None
out, err = p.communicate()
ret_code = p.returncode
log.debug('output: {o}'.format(o=out))