104 lines
4.2 KiB
Diff
104 lines
4.2 KiB
Diff
From 2595c75cb8488e855fc5d98bcc944c6c0ad96b54 Mon Sep 17 00:00:00 2001
|
|
From: Quique Llorente <ellorent@redhat.com>
|
|
Date: Tue, 24 Nov 2020 12:52:35 +0100
|
|
Subject: [PATCH 1/2] ovs: Ignore ovs-port always
|
|
|
|
At containerize nmstate we cannot run "systemctl openvswitch status" so
|
|
even with a openvswitch running at host it will appear as non running
|
|
but the ovs information will arrive from NM dbus interface. This breaks
|
|
nmstatectl show since ovs-port is not part of nmstate and is not
|
|
included in the schema. This change just ignore ovs-port even if
|
|
openvswitch appear as not running.
|
|
|
|
Signed-off-by: Quique Llorente <ellorent@redhat.com>
|
|
Signed-off-by: Gris Ge <fge@redhat.com>
|
|
---
|
|
libnmstate/nm/plugin.py | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/libnmstate/nm/plugin.py b/libnmstate/nm/plugin.py
|
|
index 4032359..6b6217d 100644
|
|
--- a/libnmstate/nm/plugin.py
|
|
+++ b/libnmstate/nm/plugin.py
|
|
@@ -123,6 +123,8 @@ class NetworkManagerPlugin(NmstatePlugin):
|
|
if nm_bond.is_bond_type_id(type_id):
|
|
bondinfo = nm_bond.get_bond_info(dev)
|
|
iface_info.update(_ifaceinfo_bond(bondinfo))
|
|
+ elif nm_ovs.is_ovs_port_type_id(type_id):
|
|
+ continue
|
|
elif NmstatePlugin.OVS_CAPABILITY in capabilities:
|
|
if nm_ovs.is_ovs_bridge_type_id(type_id):
|
|
iface_info["bridge"] = nm_ovs.get_ovs_info(
|
|
@@ -133,8 +135,6 @@ class NetworkManagerPlugin(NmstatePlugin):
|
|
)
|
|
elif nm_ovs.is_ovs_interface_type_id(type_id):
|
|
iface_info.update(nm_ovs.get_interface_info(act_con))
|
|
- elif nm_ovs.is_ovs_port_type_id(type_id):
|
|
- continue
|
|
|
|
info.append(iface_info)
|
|
|
|
--
|
|
2.29.2
|
|
|
|
|
|
From 3202bdd08737087160ff96bcf921793ce6b8335c Mon Sep 17 00:00:00 2001
|
|
From: Quique Llorente <ellorent@redhat.com>
|
|
Date: Wed, 25 Nov 2020 10:28:43 +0100
|
|
Subject: [PATCH 2/2] ovs: Ignore OVS capabilities at get interfaces
|
|
|
|
At containerize nmstate we cannot run "systemctl openvswitch status" so
|
|
even with a openvswitch running at host it will appear as non running
|
|
but the ovs information will arrive from NM dbus interface. This breaks
|
|
nmstatectl show since ovs-port is not part of nmstate and is not
|
|
included in the schema. This change removed the whole OVS compatibility check
|
|
when processing the interfaces reporting.
|
|
|
|
Signed-off-by: Quique Llorente <ellorent@redhat.com>
|
|
Signed-off-by: Gris Ge <fge@redhat.com>
|
|
---
|
|
libnmstate/nm/plugin.py | 18 +++++++-----------
|
|
1 file changed, 7 insertions(+), 11 deletions(-)
|
|
|
|
diff --git a/libnmstate/nm/plugin.py b/libnmstate/nm/plugin.py
|
|
index 6b6217d..06a5acd 100644
|
|
--- a/libnmstate/nm/plugin.py
|
|
+++ b/libnmstate/nm/plugin.py
|
|
@@ -97,7 +97,6 @@ class NetworkManagerPlugin(NmstatePlugin):
|
|
|
|
def get_interfaces(self):
|
|
info = []
|
|
- capabilities = self.capabilities
|
|
|
|
devices_info = [
|
|
(dev, nm_device.get_device_common_info(dev))
|
|
@@ -123,18 +122,15 @@ class NetworkManagerPlugin(NmstatePlugin):
|
|
if nm_bond.is_bond_type_id(type_id):
|
|
bondinfo = nm_bond.get_bond_info(dev)
|
|
iface_info.update(_ifaceinfo_bond(bondinfo))
|
|
+ elif nm_ovs.is_ovs_bridge_type_id(type_id):
|
|
+ iface_info["bridge"] = nm_ovs.get_ovs_info(
|
|
+ self.context, dev, devices_info
|
|
+ )
|
|
+ iface_info = _remove_ovs_bridge_unsupported_entries(iface_info)
|
|
+ elif nm_ovs.is_ovs_interface_type_id(type_id):
|
|
+ iface_info.update(nm_ovs.get_interface_info(act_con))
|
|
elif nm_ovs.is_ovs_port_type_id(type_id):
|
|
continue
|
|
- elif NmstatePlugin.OVS_CAPABILITY in capabilities:
|
|
- if nm_ovs.is_ovs_bridge_type_id(type_id):
|
|
- iface_info["bridge"] = nm_ovs.get_ovs_info(
|
|
- self.context, dev, devices_info
|
|
- )
|
|
- iface_info = _remove_ovs_bridge_unsupported_entries(
|
|
- iface_info
|
|
- )
|
|
- elif nm_ovs.is_ovs_interface_type_id(type_id):
|
|
- iface_info.update(nm_ovs.get_interface_info(act_con))
|
|
|
|
info.append(iface_info)
|
|
|
|
--
|
|
2.29.2
|
|
|