ca44bc
import nmstate-0.3.4-13.el8_3
@@ -0,0 +1,111 @@
|
|
1
|
+
From 36ee761dd0d671439323077e4f77a89071fdcd9c Mon Sep 17 00:00:00 2001
|
2
|
+
From: Edward Haas <edwardh@redhat.com>
|
3
|
+
Date: Wed, 7 Oct 2020 20:13:12 +0300
|
4
|
+
Subject: [PATCH 1/2] nm, bridge, ovs: Collect only existing profiles
|
5
|
+
|
6
|
+
During the reporting flow, connections that are in teardown process
|
7
|
+
no longer point to a valid profile. Avoid collecting such profiles (in
|
8
|
+
practice, these are actually `None` objects).
|
9
|
+
|
10
|
+
Signed-off-by: Edward Haas <edwardh@redhat.com>
|
11
|
+
Signed-off-by: Gris Ge <fge@redhat.com>
|
12
|
+
---
|
13
|
+
libnmstate/nm/bridge.py | 6 +++---
|
14
|
+
libnmstate/nm/ovs.py | 4 +++-
|
15
|
+
2 files changed, 6 insertions(+), 4 deletions(-)
|
16
|
+
|
17
|
+
diff --git a/libnmstate/nm/bridge.py b/libnmstate/nm/bridge.py
|
18
|
+
index b885f7a..0ca6c2d 100644
|
19
|
+
--- a/libnmstate/nm/bridge.py
|
20
|
+
+++ b/libnmstate/nm/bridge.py
|
21
|
+
@@ -260,9 +260,9 @@ def _get_slave_profiles_by_name(master_device):
|
22
|
+
for dev in master_device.get_slaves():
|
23
|
+
active_con = connection.get_device_active_connection(dev)
|
24
|
+
if active_con:
|
25
|
+
- slaves_profiles_by_name[
|
26
|
+
- dev.get_iface()
|
27
|
+
- ] = active_con.props.connection
|
28
|
+
+ profile = active_con.props.connection
|
29
|
+
+ if profile:
|
30
|
+
+ slaves_profiles_by_name[dev.get_iface()] = profile
|
31
|
+
return slaves_profiles_by_name
|
32
|
+
|
33
|
+
|
34
|
+
diff --git a/libnmstate/nm/ovs.py b/libnmstate/nm/ovs.py
|
35
|
+
index 2518773..eb373c3 100644
|
36
|
+
--- a/libnmstate/nm/ovs.py
|
37
|
+
+++ b/libnmstate/nm/ovs.py
|
38
|
+
@@ -279,5 +279,7 @@ def _get_slave_profiles(master_device, devices_info):
|
39
|
+
if active_con:
|
40
|
+
master = active_con.props.master
|
41
|
+
if master and (master.get_iface() == master_device.get_iface()):
|
42
|
+
- slave_profiles.append(active_con.props.connection)
|
43
|
+
+ profile = active_con.props.connection
|
44
|
+
+ if profile:
|
45
|
+
+ slave_profiles.append(profile)
|
46
|
+
return slave_profiles
|
47
|
+
--
|
48
|
+
2.28.0
|
49
|
+
|
50
|
+
|
51
|
+
From caf638d75e57da8770cd884782475f1c5668fd6d Mon Sep 17 00:00:00 2001
|
52
|
+
From: Edward Haas <edwardh@redhat.com>
|
53
|
+
Date: Wed, 7 Oct 2020 12:26:42 +0300
|
54
|
+
Subject: [PATCH 2/2] nm, ovs: Fix report crash when OVS has dup iface names
|
55
|
+
|
56
|
+
In case of an existing OVS deployment which uses an identical name for
|
57
|
+
the bridge, port and interface, libnmstate.show() exploded.
|
58
|
+
|
59
|
+
It is now possible to report such deployments.
|
60
|
+
|
61
|
+
Signed-off-by: Edward Haas <edwardh@redhat.com>
|
62
|
+
Signed-off-by: Gris Ge <fge@redhat.com>
|
63
|
+
---
|
64
|
+
libnmstate/nm/ovs.py | 24 +++++++++++++++++++++---
|
65
|
+
1 file changed, 21 insertions(+), 3 deletions(-)
|
66
|
+
|
67
|
+
diff --git a/libnmstate/nm/ovs.py b/libnmstate/nm/ovs.py
|
68
|
+
index eb373c3..d1f26ba 100644
|
69
|
+
--- a/libnmstate/nm/ovs.py
|
70
|
+
+++ b/libnmstate/nm/ovs.py
|
71
|
+
@@ -140,7 +140,12 @@ def get_port_by_slave(nmdev):
|
72
|
+
|
73
|
+
|
74
|
+
def get_ovs_info(context, bridge_device, devices_info):
|
75
|
+
- port_profiles = _get_slave_profiles(bridge_device, devices_info)
|
76
|
+
+ ovs_ports_info = (
|
77
|
+
+ info
|
78
|
+
+ for info in devices_info
|
79
|
+
+ if is_ovs_port_type_id(info[1]["type_id"])
|
80
|
+
+ )
|
81
|
+
+ port_profiles = _get_slave_profiles(bridge_device, ovs_ports_info)
|
82
|
+
ports = _get_bridge_ports_info(context, port_profiles, devices_info)
|
83
|
+
options = _get_bridge_options(context, bridge_device)
|
84
|
+
|
85
|
+
@@ -203,8 +208,21 @@ def _get_bridge_port_info(context, port_profile, devices_info):
|
86
|
+
vlan_mode = port_setting.props.vlan_mode
|
87
|
+
|
88
|
+
port_name = port_profile.get_interface_name()
|
89
|
+
- port_device = context.get_nm_dev(port_name)
|
90
|
+
- port_slave_profiles = _get_slave_profiles(port_device, devices_info)
|
91
|
+
+ port_device = next(
|
92
|
+
+ dev
|
93
|
+
+ for dev, devinfo in devices_info
|
94
|
+
+ if devinfo["name"] == port_name
|
95
|
+
+ and is_ovs_port_type_id(devinfo["type_id"])
|
96
|
+
+ )
|
97
|
+
+ devices_info_excluding_bridges_and_ports = (
|
98
|
+
+ info
|
99
|
+
+ for info in devices_info
|
100
|
+
+ if not is_ovs_bridge_type_id(info[1]["type_id"])
|
101
|
+
+ and not is_ovs_port_type_id(info[1]["type_id"])
|
102
|
+
+ )
|
103
|
+
+ port_slave_profiles = _get_slave_profiles(
|
104
|
+
+ port_device, devices_info_excluding_bridges_and_ports
|
105
|
+
+ )
|
106
|
+
port_slave_names = [c.get_interface_name() for c in port_slave_profiles]
|
107
|
+
|
108
|
+
if port_slave_names:
|
109
|
+
--
|
110
|
+
2.28.0
|
111
|
+
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Name: nmstate
|
6
6
|
Version: 0.3.4
|
7
|
-
Release:
|
7
|
+
Release: 13%{?dist}
|
8
8
|
Summary: Declarative network manager API
|
9
9
|
License: LGPLv2+
|
10
10
|
URL: https://github.com/%{srcname}/%{srcname}
|
@@ -19,6 +19,7 @@ Patch5: BZ_1858758-fix_ovs_bond.patch
|
|
19
19
|
Patch6: BZ_1859844-fix_converting_memory_only.patch
|
20
20
|
Patch7: BZ_1866269-preserve_nm_uuid_in_ovsdb.patch
|
21
21
|
Patch8: BZ_1869345_ovsdb_remove_all_ports.patch
|
22
|
+
Patch9: BZ_1887349-Allow-duplicate-iface-name-in-ovs.patch
|
22
23
|
BuildArch: noarch
|
23
24
|
BuildRequires: python3-devel
|
24
25
|
BuildRequires: python3-setuptools
|
@@ -89,6 +90,9 @@ gpgv2 --keyring ./gpgkey-mantainers.gpg %{SOURCE1} %{SOURCE0}
|
|
89
90
|
%{python3_sitelib}/%{libname}/plugins/__pycache__/nmstate_plugin_ovsdb*
|
90
91
|
|
91
92
|
%changelog
|
93
|
+
* Wed Oct 14 2020 Gris Ge <fge@redhat.com> - 0.3.4-13
|
94
|
+
- Allowing duplicate interface name of ovs. RHBZ#1887349
|
95
|
+
|
92
96
|
* Tue Aug 18 2020 Gris Ge <fge@redhat.com> - 0.3.4-12
|
93
97
|
- New patch: OVSDB: Allowing remove all OVS ports. RHBZ#1869345
|
94
98
|
|