Wed, Sep 12, 2018 at 05:50:16PM CEST, csfakian(a)redhat.com wrote:
From: Christos Sfakianakis <csfakian(a)redhat.com>
Avoid termination in case cls._type_initialized or cls._moduleparams
are undefined.
Signed-off-by: Christos Sfakianakis <csfakian(a)redhat.com>
---
lnst/Devices/OvsBridgeDevice.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lnst/Devices/OvsBridgeDevice.py b/lnst/Devices/OvsBridgeDevice.py
index d54cf94..e4d843b 100644
--- a/lnst/Devices/OvsBridgeDevice.py
+++ b/lnst/Devices/OvsBridgeDevice.py
@@ -25,8 +25,10 @@ class OvsBridgeDevice(SoftDevice):
@classmethod
def _type_init(cls):
- if not cls._type_initialized:
- exec_cmd("modprobe %s %s" % ("openvswitch",
cls._moduleparams))
+ #if not cls._type_initialized:
Please remove the commented out bits.
+ if not "_type_initialized" in dir(cls):
+ exec_cmd("modprobe %s %s" % ("openvswitch", getattr(cls,
"_moduleparams", "")))
+ #exec_cmd("modprobe %s %s" % ("openvswitch",
cls._moduleparams))
Same here.
>
> if not check_process_running("ovsdb-server"):
> exec_cmd("mkdir -p /var/run/openvswitch/")
>--
>2.17.1
>_______________________________________________
>LNST-developers mailing list -- lnst-developers(a)lists.fedorahosted.org
>To unsubscribe send an email to lnst-developers-leave(a)lists.fedorahosted.org
>Fedora Code of Conduct:
https://getfedora.org/code-of-conduct.html
>List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
>List Archives:
https://lists.fedorahosted.org/archives/list/lnst-developers@lists.fedora...