Fix python3 processing out subprocess output

Fix bug where comparison failed on python3 because subprocess returns
bytes instead of string. New lines parameter assues that the result
will be string and not bytes.

WARNING: Unsupported platform 'b'fedora28'' detected by tripleo-repos,
centos7 will be used unless you use CLI param to change it.

Change-Id: Ibff584b14b69de8eadc8391eb4b6db80469e42d6
This commit is contained in:
Sorin Sbarnea 2019-02-18 19:17:33 +00:00
parent db84b7b14b
commit 70e30aa6d3
1 changed files with 2 additions and 1 deletions

View File

@ -69,7 +69,8 @@ def _parse_args():
'source /etc/os-release && echo "$ID$VERSION_ID"',
shell=True,
stdout=subprocess.PIPE,
stderr=open(os.devnull, 'w')).communicate()[0].rstrip()
stderr=open(os.devnull, 'w'),
universal_newlines=True).communicate()[0].rstrip()
if distro not in SUPPORTED_DISTROS:
print(