diff --git a/hooks/heat_utils.py b/hooks/heat_utils.py index cd0bab2..d2fc817 100644 --- a/hooks/heat_utils.py +++ b/hooks/heat_utils.py @@ -19,6 +19,7 @@ from charmhelpers.contrib.openstack.utils import ( from charmhelpers.fetch import ( apt_install, apt_update, + apt_upgrade, ) from charmhelpers.core.hookenv import ( @@ -142,6 +143,7 @@ def do_openstack_upgrade(configs): '--option', 'Dpkg::Options::=--force-confdef', ] apt_update() + apt_upgrade(options=dpkg_opts, fatal=True, dist=True) packages = BASE_PACKAGES + BASE_SERVICES apt_install(packages=packages, options=dpkg_opts, fatal=True) diff --git a/unit_tests/test_heat_utils.py b/unit_tests/test_heat_utils.py index a825c74..3a45454 100644 --- a/unit_tests/test_heat_utils.py +++ b/unit_tests/test_heat_utils.py @@ -19,6 +19,7 @@ TO_PATCH = [ 'configure_installation_source', 'apt_install', 'apt_update', + 'apt_upgrade', 'check_call', ] @@ -57,8 +58,11 @@ class HeatUtilsTests(CharmTestCase): self.get_os_codename_install_source.return_value = 'havana' configs = MagicMock() utils.do_openstack_upgrade(configs) - self.assertTrue(configs.write_all.called) + self.assertTrue(self.apt_update.called) + self.assertTrue(self.apt_upgrade.called) + self.assertTrue(self.apt_install.called) configs.set_release.assert_called_with(openstack_release='havana') + self.assertTrue(configs.write_all.called) def test_api_ports(self): cfn = utils.api_port('heat-api-cfn')