Address python3 string issues with subprocess
This patch updates our Popen call to enable newlines for calls that we parse or consume the output for. Without universal_newlines=True, the output is treated as bytes under python3 which leads to issues later where we are using it as strings. See https://docs.python.org/3/glossary.html#term-universal-newlines Story: 2006796 Task: 42712 Signed-off-by: Charles Short <charles.short@windriver.com> Change-Id: Ib9f6e9e9bb6ba465993f0ffa4579e86c52716190
This commit is contained in:
parent
1bf6946612
commit
496ce74455
|
@ -106,7 +106,8 @@ class OpenstackBaseHelm(base.BaseHelm):
|
||||||
if pw_format == common.PASSWORD_FORMAT_CEPH:
|
if pw_format == common.PASSWORD_FORMAT_CEPH:
|
||||||
try:
|
try:
|
||||||
cmd = ['ceph-authtool', '--gen-print-key']
|
cmd = ['ceph-authtool', '--gen-print-key']
|
||||||
password = subprocess.check_output(cmd).strip()
|
password = subprocess.check_output(cmd,
|
||||||
|
universal_newlines=True).strip()
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
raise exception.SysinvException(
|
raise exception.SysinvException(
|
||||||
'Failed to generate ceph key')
|
'Failed to generate ceph key')
|
||||||
|
|
Loading…
Reference in New Issue