Merge "Address python3 string issues with subprocess"
This commit is contained in:
commit
d385118e8d
@ -103,7 +103,8 @@ def pull_image(name):
|
||||
|
||||
subproc = subprocess.Popen([cli_cmd, 'inspect', name],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
stderr=subprocess.PIPE,
|
||||
universal_newlines=True)
|
||||
cmd_stdout, cmd_stderr = subproc.communicate()
|
||||
retval = subproc.returncode
|
||||
if retval == 0:
|
||||
@ -117,7 +118,8 @@ def pull_image(name):
|
||||
count += 1
|
||||
subproc = subprocess.Popen([cli_cmd, 'pull', name],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
stderr=subprocess.PIPE,
|
||||
universal_newlines=True)
|
||||
|
||||
cmd_stdout, cmd_stderr = subproc.communicate()
|
||||
retval = subproc.returncode
|
||||
@ -162,7 +164,8 @@ def rm_container(name):
|
||||
log.info('Diffing container: %s' % name)
|
||||
subproc = subprocess.Popen([cli_cmd, 'diff', name],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
stderr=subprocess.PIPE,
|
||||
universal_newlines=True)
|
||||
cmd_stdout, cmd_stderr = subproc.communicate()
|
||||
if cmd_stdout:
|
||||
log.debug(cmd_stdout)
|
||||
@ -172,7 +175,8 @@ def rm_container(name):
|
||||
log.info('Removing container: %s' % name)
|
||||
subproc = subprocess.Popen([cli_cmd, 'rm', name],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
stderr=subprocess.PIPE,
|
||||
universal_newlines=True)
|
||||
cmd_stdout, cmd_stderr = subproc.communicate()
|
||||
if cmd_stdout:
|
||||
log.debug(cmd_stdout)
|
||||
@ -462,7 +466,8 @@ def mp_puppet_config(*args):
|
||||
cmd = [cli_cmd, 'start', '-a', uname]
|
||||
count += 1
|
||||
subproc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE, env=env)
|
||||
stderr=subprocess.PIPE, env=env,
|
||||
universal_newlines=True)
|
||||
cmd_stdout, cmd_stderr = subproc.communicate()
|
||||
retval = subproc.returncode
|
||||
# puppet with --detailed-exitcodes will return 0 for success and no changes
|
||||
|
@ -200,7 +200,7 @@ def process_templates_and_get_reference_parameters():
|
||||
'--network-data ' + OPTS.network_data,
|
||||
'--output-dir ' + temp_dir]
|
||||
child = subprocess.Popen(' '.join(cmd), shell=True, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
stderr=subprocess.PIPE, universal_newlines=True)
|
||||
out, err = child.communicate()
|
||||
if not child.returncode == 0:
|
||||
raise RuntimeError('Error processing templates: %s' % err)
|
||||
|
Loading…
Reference in New Issue
Block a user