Merge "Address python3 string issues with subprocess"

This commit is contained in:
Zuul 2019-01-29 12:31:01 +00:00 committed by Gerrit Code Review
commit 607a9604a2
2 changed files with 6 additions and 3 deletions

View File

@ -1219,7 +1219,8 @@ class PythonImageUploader(BaseImageUploader):
cmd.append(pull_source)
LOG.info('Running %s' % ' '.join(cmd))
env = os.environ.copy()
process = subprocess.Popen(cmd, env=env, stdout=subprocess.PIPE)
process = subprocess.Popen(cmd, env=env, stdout=subprocess.PIPE,
universal_newlines=True)
out, err = process.communicate()
LOG.info(out)
@ -1507,7 +1508,8 @@ class PythonImageUploader(BaseImageUploader):
cmd = ['podman', 'rmi', image_url.path]
LOG.info('Running %s' % ' '.join(cmd))
env = os.environ.copy()
process = subprocess.Popen(cmd, env=env, stdout=subprocess.PIPE)
process = subprocess.Popen(cmd, env=env, stdout=subprocess.PIPE,
universal_newlines=True)
out, err = process.communicate()
LOG.info(out)

View File

@ -2075,7 +2075,8 @@ class TestPythonImageUploader(base.TestCase):
'podman',
'rmi',
'/t/nova-api:latest'],
env={}, stdout=-1
env={}, stdout=-1,
universal_newlines=True
)
@mock.patch('tripleo_common.image.image_uploader.'