From: Christos Sfakianakis csfakian@redhat.com
Use systemd to activate openvswitch and take care of any dependencies. Remove the rest of the code as: - modprobe, ovsdb-server, ovs-vswitchd are covered by systemd - _moduleparams is empty string (modinfo openvswitch)
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Devices/OvsBridgeDevice.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/lnst/Devices/OvsBridgeDevice.py b/lnst/Devices/OvsBridgeDevice.py index d54cf94..ff8232a 100644 --- a/lnst/Devices/OvsBridgeDevice.py +++ b/lnst/Devices/OvsBridgeDevice.py @@ -25,18 +25,7 @@ class OvsBridgeDevice(SoftDevice):
@classmethod def _type_init(cls): - if not cls._type_initialized: - exec_cmd("modprobe %s %s" % ("openvswitch", cls._moduleparams)) - - if not check_process_running("ovsdb-server"): - exec_cmd("mkdir -p /var/run/openvswitch/") - exec_cmd("ovsdb-server --detach --pidfile "\ - "--remote=punix:/var/run/openvswitch/db.sock", - die_on_err=False) - if not check_process_running("ovs-vswitchd"): - exec_cmd("ovs-vswitchd --detach --pidfile", die_on_err=False) - - cls._type_initialized = True + exec_cmd("systemctl start openvswitch.service", die_on_err=False)
def _create(self): exec_cmd("ovs-vsctl add-br %s" % self.name)