From b2205f773aee9f5b5f1948c280579f1942a0b86b Mon Sep 17 00:00:00 2001 From: tzing_t Date: Thu, 30 May 2024 12:33:45 +0000 Subject: [PATCH] fix NLMSGERR_ATTR_UNUSED error (cherry picked from commit 2a27f14e4946c7feeb7538523e6664d0ea50bf1f) --- Fix_NLMSGERR_ATTR_UNUSED_error.patch | 108 +++++++++++++++++++++++++++ openstack-neutron.spec | 7 +- 2 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 Fix_NLMSGERR_ATTR_UNUSED_error.patch diff --git a/Fix_NLMSGERR_ATTR_UNUSED_error.patch b/Fix_NLMSGERR_ATTR_UNUSED_error.patch new file mode 100644 index 0000000..adb023b --- /dev/null +++ b/Fix_NLMSGERR_ATTR_UNUSED_error.patch @@ -0,0 +1,108 @@ +diff --git a/neutron/agent/linux/ip_lib.py b/neutron/agent/linux/ip_lib.py +index e95dce3..320253d 100644 +--- a/neutron/agent/linux/ip_lib.py ++++ b/neutron/agent/linux/ip_lib.py +@@ -526,8 +526,8 @@ class IpLinkCommand(IpDeviceCommandBase): + return privileged.get_link_vfs(self.name, self._parent.namespace) + + def set_vf_feature(self, vf_config): +- return privileged.set_link_vf_feature( +- self.name, self._parent.namespace, vf_config) ++ privileged.set_link_vf_feature(self.name, self._parent.namespace, ++ vf_config) + + + class IpAddrCommand(IpDeviceCommandBase): +diff --git a/neutron/privileged/agent/linux/ip_lib.py b/neutron/privileged/agent/linux/ip_lib.py +index 0d06003..b68d703 100644 +--- a/neutron/privileged/agent/linux/ip_lib.py ++++ b/neutron/privileged/agent/linux/ip_lib.py +@@ -357,7 +357,7 @@ def create_interface(ifname, namespace, kind, **kwargs): + if physical_interface: + link_key = "vxlan_link" if kind == "vxlan" else "link" + kwargs[link_key] = get_link_id(physical_interface, namespace) +- return ip.link("add", ifname=ifname, kind=kind, **kwargs) ++ ip.link("add", ifname=ifname, kind=kind, **kwargs) + except netlink_exceptions.NetlinkError as e: + if e.code == errno.EEXIST: + raise InterfaceAlreadyExists(device=ifname) +@@ -388,36 +388,35 @@ def interface_exists(ifname, namespace): + def set_link_flags(device, namespace, flags): + link = _run_iproute_link("get", device, namespace)[0] + new_flags = flags | link['flags'] +- return _run_iproute_link("set", device, namespace, flags=new_flags) ++ _run_iproute_link("set", device, namespace, flags=new_flags) + + + @privileged.default.entrypoint + def set_link_attribute(device, namespace, **attributes): +- return _run_iproute_link("set", device, namespace, **attributes) ++ _run_iproute_link("set", device, namespace, **attributes) + + + @privileged.default.entrypoint + def set_link_vf_feature(device, namespace, vf_config): +- return _run_iproute_link("set", device, namespace=namespace, vf=vf_config) ++ _run_iproute_link("set", device, namespace=namespace, vf=vf_config) + + + @privileged.default.entrypoint + def set_link_bridge_forward_delay(device, forward_delay, namespace=None): +- return _run_iproute_link('set', device, namespace=namespace, +- kind='bridge', br_forward_delay=forward_delay) ++ _run_iproute_link('set', device, namespace=namespace, kind='bridge', ++ br_forward_delay=forward_delay) + + + @privileged.default.entrypoint + def set_link_bridge_stp(device, stp, namespace=None): +- return _run_iproute_link('set', device, namespace=namespace, +- kind='bridge', br_stp_state=stp) ++ _run_iproute_link('set', device, namespace=namespace, kind='bridge', ++ br_stp_state=stp) + + + @privileged.default.entrypoint + def set_link_bridge_master(device, bridge, namespace=None): + bridge_idx = get_link_id(bridge, namespace) if bridge else 0 +- return _run_iproute_link('set', device, namespace=namespace, +- master=bridge_idx) ++ _run_iproute_link('set', device, namespace=namespace, master=bridge_idx) + + + @tenacity.retry( +@@ -856,26 +855,26 @@ def _command_bridge_fdb(command, mac, device, dst_ip=None, namespace=None, + @privileged.default.entrypoint + def add_bridge_fdb(mac, device, dst_ip=None, namespace=None, **kwargs): + """Add a FDB entry""" +- return _command_bridge_fdb('add', mac, device, dst_ip=dst_ip, +- namespace=namespace, **kwargs) ++ _command_bridge_fdb('add', mac, device, dst_ip=dst_ip, ++ namespace=namespace, **kwargs) + + + @privileged.default.entrypoint + def append_bridge_fdb(mac, device, dst_ip=None, namespace=None, **kwargs): + """Add a FDB entry""" +- return _command_bridge_fdb('append', mac, device, dst_ip=dst_ip, +- namespace=namespace, **kwargs) ++ _command_bridge_fdb('append', mac, device, dst_ip=dst_ip, ++ namespace=namespace, **kwargs) + + + @privileged.default.entrypoint + def replace_bridge_fdb(mac, device, dst_ip=None, namespace=None, **kwargs): + """Add a FDB entry""" +- return _command_bridge_fdb('replace', mac, device, dst_ip=dst_ip, +- namespace=namespace, **kwargs) ++ _command_bridge_fdb('replace', mac, device, dst_ip=dst_ip, ++ namespace=namespace, **kwargs) + + + @privileged.default.entrypoint + def delete_bridge_fdb(mac, device, dst_ip=None, namespace=None, **kwargs): + """Add a FDB entry""" +- return _command_bridge_fdb('del', mac, device, dst_ip=dst_ip, +- namespace=namespace, **kwargs) ++ _command_bridge_fdb('del', mac, device, dst_ip=dst_ip, ++ namespace=namespace, **kwargs) diff --git a/openstack-neutron.spec b/openstack-neutron.spec index 291217e..ac6a2c0 100644 --- a/openstack-neutron.spec +++ b/openstack-neutron.spec @@ -18,7 +18,7 @@ capabilities (e.g., QoS, ACLs, network monitoring, etc.) Name: openstack-%{service} Version: 18.6.0 -Release: 2 +Release: 3 Summary: OpenStack Networking Service License: ASL 2.0 @@ -55,6 +55,8 @@ Source37: neutron-ovn-metadata-agent.service # Required for tarball sources verification Patch000: Replace_deprecated_import_ABCs_from_collections.patch +Patch001: Fix_NLMSGERR_ATTR_UNUSED_error.patch + BuildArch: noarch BuildRequires: git-core @@ -848,6 +850,9 @@ fi %{_datadir}/ansible/neutron-ovn-migration/ %changelog +* Thu May 30 2024 tzing_t - 18.6.0-3 +- Fix NLMSGERR_ATTR_UNUSED error + * Sat May 25 2024 tzing_t - 18.6.0-2 - Replace deprecated import ABCs from collections -- Gitee