Comment 2 for bug 1996157

Revision history for this message
wang.chao (m986883511) wrote : Re: horizon use error python version

find error config with python3.6:
grep -rn 'python3.6' in /etc/kolla

fix problem manually use this command, then reboot host
sed -i "s/python3.6/python2.7/g" `grep python2.7 -rl /etc/kolla`

-------------------------------------------------------------------------------
analysix:
#########################
# Internal Image options
#########################
distro_python_version_map: {
  "centos": "{{ '3.6' if ansible_distribution_major_version is version(8, '>=') else '2.7' }}",
  "debian": "3.7",
  "rhel": "{{ '3.6' if ansible_distribution_major_version is version(8, '>=') else '2.7' }}",
  "ubuntu": "3.6"
}

distro_python_version: "{{ distro_python_version_map[kolla_base_distro] }}"

my ansible_distribution_major_version is 22, the host system is ubuntu22.04.
[root@ubuntu-NUC10i5FNH ~]# ansible -i all-in-one all -m setup |grep ansible_distribution_major_version
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details
        "ansible_distribution_major_version": "22",

horizon use {{distro_python_version}} to switch python version, my {{kolla_base_distro}} is centos, why use host's ansible_distribution_major_version to switch centos python version? Is this a bug?