apt upgrade packages during openstack upgrade

This commit is contained in:
Corey Bryant 2015-09-22 20:21:39 +00:00
parent a77f97c13d
commit 0921e84ca7
2 changed files with 7 additions and 1 deletions

View File

@ -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)

View File

@ -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')