~haproxy-team/charm-haproxy/trunk

« back to all changes in this revision

Viewing changes to hooks/install

  • Committer: mergebot at canonical
  • Author(s): "Thomas Cuthbert"
  • Date: 2021-10-11 07:26:41 UTC
  • mfrom: (143.1.2 charm-haproxy)
  • Revision ID: mergebot@juju-139df4-prod-is-toolbox-0.canonical.com-20211011072641-978k26ymm17yr823
fix: general fixes for using correct python version.

Reviewed-on: https://code.launchpad.net/~tcuthbert/charm-haproxy/haproxy-focal/+merge/409962
Reviewed-by: Joel Sing <joel.sing@canonical.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
    DEBIAN_FRONTEND=noninteractive apt-get -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install $@
7
7
}
8
8
 
 
9
apt-get -y update
 
10
 
9
11
juju-log 'Invoking charm-pre-install hooks'
10
12
[ -d exec.d ] && ( for f in exec.d/*/charm-pre-install; do [ -x $f ] && /bin/sh -c "$f"; done )
11
13
 
12
 
DISTRIB_CODENAME=$(grep DISTRIB_CODENAME /etc/lsb-release | cut -d= -f2)
13
 
if [ "${DISTRIB_CODENAME}" = "focal" ]; then
 
14
if awk -v bionic="18.04.5" -v distrib="$(lsb_release -rs)" 'BEGIN{distrib >= bionic}'
 
15
then
14
16
    # Install missing python-yaml and python-apt packages
15
17
    apt-get install -y python2 python-yaml python-apt
16
18