Restart ivs/nvfswitch after config file is updated

This change - https://review.openstack.org/#/c/561609/, removed the
restart of ivs/nvfswitch to avoid network interruptions. However,
when a change is made to the config file then ivs/nvfswitch must be
restarted in order to pick up the change.

Closes-Bug: #1794182
Change-Id: I8f879072799cef29c09ddc74bd71069dd168ec88
(cherry picked from commit 2495c9ddaa)
This commit is contained in:
Bob Fournier 2018-09-24 16:30:14 -04:00
parent c79a3bae4f
commit 0571a6baf5
2 changed files with 15 additions and 2 deletions

View File

@ -1110,13 +1110,21 @@ class IfcfgNetConfig(os_net_config.NetConfig):
if ivs_uplinks or ivs_interfaces:
location = ivs_config_path()
data = self.generate_ivs_config(ivs_uplinks, ivs_interfaces)
self.write_config(location, data)
if (utils.diff(location, data)):
self.write_config(location, data)
msg = "Restart ivs"
self.execute(msg, '/usr/bin/systemctl',
'restart', 'ivs')
if nfvswitch_interfaces or nfvswitch_internal_ifaces:
location = nfvswitch_config_path()
data = self.generate_nfvswitch_config(nfvswitch_interfaces,
nfvswitch_internal_ifaces)
self.write_config(location, data)
if (utils.diff(location, data)):
self.write_config(location, data)
msg = "Restart nfvswitch"
self.execute(msg, '/usr/bin/systemctl',
'restart', 'nfvswitch')
if activate:
for linux_team in restart_linux_teams:

View File

@ -0,0 +1,5 @@
---
fixes:
- When the ivs interface (or nfvswitch) configuration changes,
ivs (or nvfswitch) needs to be restarted in order to pick
up the new configuration.