Merge lp:~vern/charm-haproxy/fix-install-hook into lp:charm-haproxy

Proposed by Vern Hart
Status: Merged
Approved by: Tom Haddon
Approved revision: 148
Merged at revision: 148
Proposed branch: lp:~vern/charm-haproxy/fix-install-hook
Merge into: lp:charm-haproxy
Diff against target: 36 lines (+7/-17)
1 file modified
hooks/install (+7/-17)
To merge this branch: bzr merge lp:~vern/charm-haproxy/fix-install-hook
Reviewer Review Type Date Requested Status
Tom Haddon Approve
Paul Collins lgtm Approve
Review via email: mp+410140@code.launchpad.net

Commit message

Simplify install hook (works on bionic and focal).

Fixes: https://bugs.launchpad.net/charm-haproxy/+bug/1946798

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Paul Collins (pjdc) :
review: Approve (lgtm)
Revision history for this message
Vern Hart (vern) wrote :

Note that I tested this on bionic and focal by deploying with --series:

  juju deploy ../../charms/haproxy haproxyb --bind oam-space --series bionic --to lxd:0
  juju deploy ../../charms/haproxy haproxyf --bind oam-space --series focal --to lxd:0

And verifying that the charms installed correctly.

Revision history for this message
Tom Haddon (mthaddon) wrote :

This is a nice simplification. Thanks.

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 148

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/install'
--- hooks/install 2021-10-13 14:16:58 +0000
+++ hooks/install 2021-10-13 15:17:05 +0000
@@ -2,25 +2,15 @@
22
3set -eu3set -eu
44
5apt_get_install() {
6 DEBIAN_FRONTEND=noninteractive apt-get -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install $@
7}
8
9apt-get -y update5apt-get -y update
106
11juju-log 'Invoking charm-pre-install hooks'7juju-log 'Invoking charm-pre-install hooks'
12[ -d exec.d ] && ( for f in exec.d/*/charm-pre-install; do [ -x $f ] && /bin/sh -c "$f"; done )8[ -d exec.d ] && ( for f in exec.d/*/charm-pre-install; do [ -x $f ] && /bin/sh -c "$f"; done )
139
14if dpkg --compare-versions "$(lsb_release -rs)" ge 20.04; then10# Install missing python-yaml and python-apt packages
15 # Install missing python-yaml and python-apt packages11# Note that these depend on python2 on focal and newer
16 apt-get install -y python2 python-yaml python-apt12apt-get install -y python-yaml python-apt
1713
18 juju-log 'Invoking python-based install hook'14juju-log 'Invoking python-based install hook'
19 python2 hooks/hooks.py install15# use python2 because python is 3 on focal or newer
20else16python2 hooks/hooks.py install
21 # Install missing python-yaml and python-apt packages
22 apt-get install -y python-yaml python-apt
23
24 juju-log 'Invoking python-based install hook'
25 python hooks/hooks.py install
26fi

Subscribers

People subscribed via source and target branches

to all changes: