"stdout: ",
"stderr: + command -v python3",
"+ python3 /docker-config-scripts/nova_cell_v2_discover_host.py",
"Traceback (most recent call last):",
" File \"/docker-config-scripts/nova_cell_v2_discover_host.py\", line 75, in <module>",
" TypeError: a bytes-like object is required, not 'str'"
This is because in python3 subprocess.check_output() will return bytes
and trying to split it using a string '\n' will break with the error
above. Let's just use the universal_newlines=True parameter which we
have been using everywhere in tripleo so far.
Also skip any empty lines that might show up in the output which would
give the error:
ValueError: not enough values to unpack (expected 2, got 0)
Tested with a python3 deployment and got a successful deployment (rhel8
os + f28 based-containers).
Reviewed: https:/ /review. openstack. org/639928 /git.openstack. org/cgit/ openstack/ tripleo- heat-templates/ commit/ ?id=e5d6b52c153 49f88788f8fea42 071ec9fd5dba5c
Committed: https:/
Submitter: Zuul
Branch: stable/rocky
commit e5d6b52c15349f8 8788f8fea42071e c9fd5dba5c
Author: Michele Baldessari <email address hidden>
Date: Wed Jan 23 14:10:41 2019 +0100
Fix nova_cell_ v2_discover_ host.py with python3
When this script runs via python3 it fails with:
"stdout: ", config- scripts/ nova_cell_ v2_discover_ host.py" , config- scripts/ nova_cell_ v2_discover_ host.py\ ", line 75, in <module>",
"stderr: + command -v python3",
"+ python3 /docker-
"Traceback (most recent call last):",
" File \"/docker-
" TypeError: a bytes-like object is required, not 'str'"
This is because in python3 subprocess. check_output( ) will return bytes newlines= True parameter which we
and trying to split it using a string '\n' will break with the error
above. Let's just use the universal_
have been using everywhere in tripleo so far.
Also skip any empty lines that might show up in the output which would
give the error:
ValueError: not enough values to unpack (expected 2, got 0)
Tested with a python3 deployment and got a successful deployment (rhel8
os + f28 based-containers).
Change-Id: Ic7904c4f3027cc 5e7e05d52757e36 dbc05f3d487 e9ff46e8fecfa14 87b3699ffa)
Co-Authored-By: Damien Ciabrini <email address hidden>
Closes-Bug: #1813014
(cherry picked from commit 87a869a408b9732