--- a/cli/ovs.py
+++ b/cli/ovs.py
@@ -120,17 +120,17 @@
def apply_ovs_cleanup(config_manager, ovs_old, ovs_current): # pragma: nocover (covered in autopkgtest)
"""
Query OpenVSwitch state through 'ovs-vsctl' and filter for netplan=true
tagged ports/bonds and bridges. Delete interfaces which are not defined
in the current configuration.
Also filter for individual settings tagged netplan/<column>[/<key]=value
in external-ids and clear them if they have been set by netplan.
"""
- if not systemctl_is_active(OPENVSWITCH_OVSDB_SERVER_UNIT):
+ if os.path.isfile(OPENVSWITCH_OVS_VSCTL) and os.access(OPENVSWITCH_OVS_VSCTL, os.X_OK) and not systemctl_is_active(OPENVSWITCH_OVSDB_SERVER_UNIT):
raise OvsDbServerNotRunning('{} is not running'.format(OPENVSWITCH_OVSDB_SERVER_UNIT))
config_manager.parse()
ovs_ifaces = set()
for i in config_manager.all_defs.keys():
if (is_ovs_interface(i, config_manager.all_defs)): ovs_ifaces.add(i)
This is perhaps a more elegant patch:
--- a/cli/ovs.py cleanup( config_ manager, ovs_old, ovs_current): # pragma: nocover (covered in autopkgtest) <column> [/<key] =value is_active( OPENVSWITCH_ OVSDB_SERVER_ UNIT): isfile( OPENVSWITCH_ OVS_VSCTL) and os.access( OPENVSWITCH_ OVS_VSCTL, os.X_OK) and not systemctl_ is_active( OPENVSWITCH_ OVSDB_SERVER_ UNIT): unning( '{} is not running' .format( OPENVSWITCH_ OVSDB_SERVER_ UNIT))
+++ b/cli/ovs.py
@@ -120,17 +120,17 @@
def apply_ovs_
"""
Query OpenVSwitch state through 'ovs-vsctl' and filter for netplan=true
tagged ports/bonds and bridges. Delete interfaces which are not defined
in the current configuration.
Also filter for individual settings tagged netplan/
in external-ids and clear them if they have been set by netplan.
"""
- if not systemctl_
+ if os.path.
raise OvsDbServerNotR
config_ manager. parse() manager. all_defs. keys(): interface( i, config_ manager. all_defs) ):
ovs_ ifaces. add(i)
ovs_ifaces = set()
for i in config_
if (is_ovs_