Restart nova-metadata-agent after upgrade to Rocky

After an upgrade to Rocky the nova-metadata-agent is broken due to
a problem importing the amqp lib. This patch simply restarts the
service after an upgrade.

Change-Id: I2c4df35b714a8af607937cb3ad4261db58ed3bbc
Closes-Bug: #1802365
This commit is contained in:
Liam Young 2018-11-09 10:03:40 +00:00
parent 94f555ab19
commit d3a6eb410e
2 changed files with 6 additions and 0 deletions

View File

@ -758,6 +758,11 @@ def do_openstack_upgrade(configs):
if installed_packages:
apt_purge(installed_packages, fatal=True)
apt_autoremove(purge=True, fatal=True)
# Bug #1802365 neutron-metadata-agent needs restarting after upgrade to
# rocky.
if CompareOpenStackReleases(os_release('neutron-common')) == 'rocky':
log('Restart neutron-metadata-agent for upgrade to rocky', level=DEBUG)
service_restart('neutron-metadata-agent')
def configure_ovs():

View File

@ -406,6 +406,7 @@ class TestNeutronUtils(CharmTestCase):
self.configure_installation_source.assert_called_with(
'cloud:bionic-rocky'
)
self.service_restart.assert_called_once_with('neutron-metadata-agent')
@patch('charmhelpers.contrib.openstack.templating.OSConfigRenderer')
def test_register_configs_ovs(self, mock_renderer):