tripleo-ansible/tripleo_ansible/roles/tripleo_ha_wrapper/tasks
Michele Baldessari bdd2cfe2df Enforce TRIPLEO_MINOR_UPDATE to be a string at all times
It can happen that TRIPLEO_MINOR_UPDATE gets interpreted as a boolean
and not as a string. This has the consequence that python
when calling subprocess.run() will call os.fsencode() on the
boolean variable and we can get the following error:

    "error": "Traceback (most recent call last):\n  File \"/tmp/ansible_tripleo_diff_exec_payload__m7cmu0z/ansible_tripleo_diff_exec_payload.zip/ansible/modules/tripleo_diff_exec.py\", line 123, in run\n  File \"/
usr/lib64/python3.6/subprocess.py\", line 423, in run\n    with Popen(*popenargs, **kwargs) as process:\n  File \"/usr/lib64/python3.6/subprocess.py\", line 729, in __init__\n    restore_signals, start_new_session
)\n  File \"/usr/lib64/python3.6/subprocess.py\", line 1275, in _execute_child\n    env_list.append(k + b'=' + os.fsencode(v))\n  File \"/usr/lib64/python3.6/os.py\", line 800, in fsencode\n    filename = fspath(f
ilename)  # Does type-checking of `filename`.\nTypeError: expected str, bytes or os.PathLike object, not bool\n",
    "invocation": {
        "module_args": {
            "command": "/var/lib/container-config-scripts/pacemaker_restart_bundle.sh cinder_volume openstack-cinder-volume openstack-cinder-volume Started",
            "environment": {
                "TRIPLEO_MINOR_UPDATE": true
            },

Let's force it to be a string so we can never hit this.

Tested on the provided reproducer.

Change-Id: Ia4caa36a6edd865b3e1dcdf9254c7f183b64faaf
Closes-Bug: #1918111
2021-03-10 10:04:26 +01:00
..
main.yml Enforce TRIPLEO_MINOR_UPDATE to be a string at all times 2021-03-10 10:04:26 +01:00