Fix py3 issue in get_undercloud_registry()
In python3 subprocess returns <class 'bytes'> type, in python2 this was <type 'str'>. Add universal_newlines argument to subprocess.Popen() call to ensure we get a string. Related: RHBZ#1762303 Closes-Bug: #1849140 Change-Id: I6fb51796d6c6b2efa82a0e96fa954f479a1641f2
This commit is contained in:
parent
d384320b13
commit
195ce10a2e
|
@ -101,7 +101,8 @@ def get_undercloud_registry():
|
|||
ctlplane_hostname = '.'.join([socket.gethostname().split('.')[0],
|
||||
'ctlplane'])
|
||||
cmd = ['getent', 'hosts', ctlplane_hostname]
|
||||
process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
||||
process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
||||
universal_newlines=True)
|
||||
out, err = process.communicate()
|
||||
|
||||
if process.returncode != 0:
|
||||
|
|
Loading…
Reference in New Issue