upgrade-charm: filter previously installed packages

The upgrade-charm hook installs any new packages required for the
new charm version however this needs to be filtered against previously
installed packages to ensure that pending package updates don't get
applied to the system as a side effect of upgrading the charm.

Change-Id: I6c490f9af2312dc42f2b56e0b7ce8c802e3aac1d
Closes-Bug: 1812982
This commit is contained in:
James Page 2019-01-23 17:09:15 +00:00
parent 3eee72c61b
commit e9ecd8284f
1 changed files with 2 additions and 1 deletions

View File

@ -419,7 +419,8 @@ def relation_broken():
@hooks.hook('upgrade-charm')
@harden()
def upgrade_charm():
apt_install(determine_packages(), fatal=True)
apt_install(filter_installed_packages(determine_packages()),
fatal=True)
# NOTE: ensure psutil install for hugepages configuration
status_set('maintenance', 'Installing apt packages')
apt_install(filter_installed_packages(['python-psutil']))