Comment 4 for bug 1946798

Revision history for this message
Vladimir Grevtsev (vlgrevtsev) wrote :

Hi all,

I'm not sure if the proposed fix [0] is going to work on Focal:

ubuntu@lsha01:~$ dpkg --compare-versions "$(lsb_release -rs)" lt 20.04
ubuntu@lsha01:~$ echo $?
1

That means, that the second block of code would be executed, invoking `python` command which is missing:

#### Focal: there's no "python" command available

ubuntu@lsha01:~$ lsb_release -rs
20.04
ubuntu@lsha01:~$ python3
Python 3.8.10 (default, Sep 28 2021, 16:10:42)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
ubuntu@lsha01:~$ python

Command 'python' not found, did you mean:

  command 'python3' from deb python3
  command 'python' from deb python-is-python3

ubuntu@lsha01:~$ python2
Python 2.7.18 (default, Mar 8 2021, 13:02:45)
[GCC 9.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

#### Bionic: should be OK for both python2 and python invocations

ubuntu@nagios01:~$ lsb_release -rs
18.04
ubuntu@nagios01:~$ python
Python 2.7.17 (default, Feb 27 2021, 15:10:58)
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
ubuntu@nagios01:~$ python3
Python 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

[0] https://bazaar.launchpad.net/~haproxy-team/charm-haproxy/trunk/revision/146/hooks/install#hooks/install