Signal Neutron service restart on OVN upgrade
Notify principal charm to restart Neutron service after OVN package upgrade Change-Id: Iedb9985ae448a7149029168a361e574a41b7ad29
This commit is contained in:
parent
9d0cb6f505
commit
63adc21543
@ -345,3 +345,8 @@ class UssuriNeutronAPIPluginCharm(BaseNeutronAPIPluginCharm):
|
||||
'packages.'.format(self.ovn_source))
|
||||
ch_fetch.add_source(self.ovn_source)
|
||||
self._upgrade_packages()
|
||||
neutron_api = reactive.endpoint_from_flag(
|
||||
'neutron-plugin.connected'
|
||||
)
|
||||
if neutron_api is not None:
|
||||
neutron_api.request_restart()
|
||||
|
@ -272,6 +272,15 @@ class TestNeutronAPIPluginOvnCharm(Helper):
|
||||
'ovn_source',
|
||||
new_callable=ovn_source_mock
|
||||
)
|
||||
|
||||
self.patch_object(charm_class, '_upgrade_packages')
|
||||
self.patch_object(neutron_api_plugin_ovn.ch_fetch, 'add_source')
|
||||
neutron_principal_mock = mock.MagicMock()
|
||||
self.patch_object(neutron_api_plugin_ovn.reactive,
|
||||
'endpoint_from_flag',
|
||||
return_value=neutron_principal_mock)
|
||||
c = neutron_api_plugin_ovn.UssuriNeutronAPIPluginCharm()
|
||||
c.upgrade_ovn()
|
||||
|
||||
self.add_source.assert_called_once_with(ovn_source_data)
|
||||
self._upgrade_packages.assert_called_once_with()
|
||||
neutron_principal_mock.request_restart.assert_called_once_with()
|
||||
|
Loading…
Reference in New Issue
Block a user