tripleo-ansible/tripleo_ansible/roles/tripleo_ha_wrapper
Michele Baldessari c7c0c5d707 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
(cherry picked from commit bdd2cfe2df)
2021-03-10 20:43:30 +01:00
..
defaults Add tripleo_ha_wrapper role 2020-09-07 15:39:15 +00:00
meta Add tripleo_ha_wrapper role 2020-09-07 15:39:15 +00:00
molecule/default Add test_deps_setup_tripleo var 2021-01-27 03:44:42 +00:00
tasks Enforce TRIPLEO_MINOR_UPDATE to be a string at all times 2021-03-10 20:43:30 +01:00