Merge "Address python3 string issues with subprocess"
This commit is contained in:
commit
46ae1d04f3
@ -143,7 +143,8 @@ class HeatBaseLauncher(object):
|
||||
p = subprocess.Popen(['mount', '-t', 'tmpfs', '-o', 'size=500M',
|
||||
'tmpfs', heatdir],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
stderr=subprocess.PIPE,
|
||||
universal_newlines=True)
|
||||
cmd_stdout, cmd_stderr = p.communicate()
|
||||
retval = p.returncode
|
||||
if retval != 0:
|
||||
@ -273,7 +274,8 @@ class HeatDockerLauncher(HeatBaseLauncher):
|
||||
'getent', 'passwd', self.user
|
||||
]
|
||||
log.debug(' '.join(cmd))
|
||||
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
||||
p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
||||
universal_newlines=True)
|
||||
result = p.communicate()[0]
|
||||
if result:
|
||||
return result.split(':')[2]
|
||||
@ -286,7 +288,8 @@ class HeatDockerLauncher(HeatBaseLauncher):
|
||||
'getent', 'group', self.user
|
||||
]
|
||||
log.debug(' '.join(cmd))
|
||||
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
||||
p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
||||
universal_newlines=True)
|
||||
result = p.communicate()[0]
|
||||
if result:
|
||||
return result.split(':')[2]
|
||||
|
@ -1056,7 +1056,8 @@ def get_short_hostname():
|
||||
|
||||
:return string
|
||||
"""
|
||||
p = subprocess.Popen(["hostname", "-s"], stdout=subprocess.PIPE)
|
||||
p = subprocess.Popen(["hostname", "-s"], stdout=subprocess.PIPE,
|
||||
universal_newlines=True)
|
||||
return p.communicate()[0].rstrip()
|
||||
|
||||
|
||||
|
@ -77,7 +77,8 @@ def _run_live_command(args, env=None, name=None, cwd=None, wait=True):
|
||||
name = args[0]
|
||||
process = subprocess.Popen(args, env=env, cwd=cwd,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT)
|
||||
stderr=subprocess.STDOUT,
|
||||
universal_newlines=True)
|
||||
if not wait:
|
||||
return process
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user