Install prerequisite packages on charm upgrade.

When upgrading the charm some package dependancies are missing
such as python3-distutils. This patch uses the same approach as the
install hook to install packages before calling the the main python
hook code.

Change-Id: If3bfa6efd5a3924f3ca6d1309f82c3867cfd4c67
Closes-Bug: #1803418
This commit is contained in:
Liam Young 2018-11-14 19:27:57 +00:00
parent 910170bed0
commit 3066151e77
4 changed files with 5 additions and 3 deletions

View File

@ -17,4 +17,5 @@ for dep in ${DEPS[@]}; do
check_and_install ${PYTHON} ${dep}
done
exec ./hooks/install.real
real_hook="./hooks/$(basename $0).real"
exec $real_hook

View File

@ -259,7 +259,7 @@ def install_vaultlocker():
apt_install(pkgs, fatal=True)
@hooks.hook('upgrade-charm')
@hooks.hook('upgrade-charm.real')
@harden()
def upgrade_charm():
initialize_ufw()

View File

@ -1 +1 @@
swift_storage_hooks.py
install

1
hooks/upgrade-charm.real Symbolic link
View File

@ -0,0 +1 @@
swift_storage_hooks.py