tripleo-heat-templates/docker_config_scripts
Michele Baldessari 87a869a408 Fix nova_cell_v2_discover_host.py with python3
When this script runs via python3 it fails with:

  "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).

Change-Id: Ic7904c4f3027cc5e7e05d52757e36dbc05f3d487
Co-Authored-By: Damien Ciabrini <dciabrin@redhat.com>
Closes-Bug: #1813014
2019-01-23 16:25:46 +01:00
..
tests Improve nova statedir ownership logic 2018-07-09 17:07:30 +01:00
__init__.py Improve nova statedir ownership logic 2018-07-09 17:07:30 +01:00
nova_cell_v2_discover_host.py Fix nova_cell_v2_discover_host.py with python3 2019-01-23 16:25:46 +01:00
nova_statedir_ownership.py Move cellv2 discovery from control plane services to compute services 2018-12-20 11:23:06 +05:30
nova_wait_for_placement_service.py Use internal interface for keystone in "wait for placement" script 2019-01-22 18:48:39 +02:00
pyshim.sh Correct file modes for rpmlint failures 2018-12-14 13:21:28 -07:00