!45 Add distributed traffic feature support

From: @A_L_I_E_Z 
Reviewed-by: @han-guangyu 
Signed-off-by: @han-guangyu
This commit is contained in:
openeuler-ci-bot 2023-11-01 02:34:20 +00:00 committed by Gitee
commit 29dd3205db
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 2634 additions and 4 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,15 @@
%define gitPatch() \
cd %1; \
git init && git config user.name "openstack-plugin" && git config user.email "openstack-plugin"; \
git add . && git commit -m "openstack-plugin init"; \
git apply --check %2 || exit 1 && git apply %2; \
git add . && git commit -m "openstack-plugin patch"
%define gitUnPatch() \
cd %1;\
git reset --hard HEAD~;\
rm -rf %1/.git
%{!?upstream_version: %global upstream_version %{version}%{?milestone}} %{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global service neutron %global service neutron
@ -18,7 +30,7 @@ capabilities (e.g., QoS, ACLs, network monitoring, etc.)
Name: openstack-%{service} Name: openstack-%{service}
Version: 15.3.4 Version: 15.3.4
Release: 2 Release: 3
Summary: OpenStack Networking Service Summary: OpenStack Networking Service
License: ASL 2.0 License: ASL 2.0
@ -51,6 +63,7 @@ Source34: neutron-l2-agent-sysctl.conf
# essentially because .modules files are shell scripts. # essentially because .modules files are shell scripts.
Source35: neutron-l2-agent.modules Source35: neutron-l2-agent.modules
Source36: neutron-destroy-patch-ports.service Source36: neutron-destroy-patch-ports.service
Source37: 0001-add-distributed-traffic-feature-support.patch
# Required for tarball sources verification # Required for tarball sources verification
BuildArch: noarch BuildArch: noarch
@ -354,6 +367,15 @@ Requires: openstack-%{service}-common = %{version}-%{release}
This package contains the Neutron agent to support advanced features of This package contains the Neutron agent to support advanced features of
SR-IOV network cards. SR-IOV network cards.
%package distributed-traffic
Summary: The plug-in package of openstack-neutron for router gateway portforwarding feature
Requires: git
Requires: python3-crudini
Requires: openstack-neutron
%description distributed-traffic
The plug-in package of openstack-neutron for router gateway portforwarding feature
%prep %prep
%autosetup -n %{service}-%{upstream_version} -S git %autosetup -n %{service}-%{upstream_version} -S git
@ -506,6 +528,9 @@ rm -f %{buildroot}%{python3_sitelib}/%{service}/locale/*/LC_*/%{service}*po
rm -f %{buildroot}%{python3_sitelib}/%{service}/locale/*pot rm -f %{buildroot}%{python3_sitelib}/%{service}/locale/*pot
mv %{buildroot}%{python3_sitelib}/%{service}/locale %{buildroot}%{_datadir}/locale mv %{buildroot}%{python3_sitelib}/%{service}/locale %{buildroot}%{_datadir}/locale
# Install router gateway portforwarding feature patch
install -D -p -m 644 %{SOURCE37} %{buildroot}%{python3_sitelib}/openstack-plugin/neutron/$(basename %{SOURCE37})
# Find language files # Find language files
%find_lang %{service} --all-name %find_lang %{service} --all-name
@ -623,6 +648,22 @@ fi
%systemd_postun_with_restart neutron-sriov-nic-agent.service %systemd_postun_with_restart neutron-sriov-nic-agent.service
%cleanup_orphan_rootwrap_daemons %cleanup_orphan_rootwrap_daemons
%post distributed-traffic
export patch_name=$(basename %{SOURCE37})
%gitPatch %{python3_sitelib}/neutron %{python3_sitelib}/openstack-plugin/neutron/$patch_name
crudini --set %{python3_sitelib}/neutron-*.egg-info/entry_points.txt neutron.objects RGPortForwarding neutron.objects.rg_port_forwarding:RGPortForwarding
crudini --set %{python3_sitelib}/neutron-*.egg-info/entry_points.txt neutron.service_plugins rg_port_forwarding neutron.services.rg_portforwarding.pf_plugin:RGPortForwardingPlugin
crudini --set %{python3_sitelib}/neutron-*.egg-info/entry_points.txt neutron.agent.l3.extensions rg_port_forwarding neutron.agent.l3.extensions.rg_port_forwarding:RGPortForwardingAgentExtension
%preun distributed-traffic
%gitUnPatch %{python3_sitelib}/neutron
crudini --del %{python3_sitelib}/neutron-*.egg-info/entry_points.txt neutron.objects RGPortForwarding
crudini --del %{python3_sitelib}/neutron-*.egg-info/entry_points.txt neutron.service_plugins rg_port_forwarding
crudini --del %{python3_sitelib}/neutron-*.egg-info/entry_points.txt neutron.agent.l3.extensions rg_port_forwarding
%files %files
%license LICENSE %license LICENSE
%{_bindir}/neutron-api %{_bindir}/neutron-api
@ -772,9 +813,15 @@ fi
%config(noreplace) %attr(0640, root, %{service}) %{_sysconfdir}/%{service}/plugins/ml2/sriov_agent.ini %config(noreplace) %attr(0640, root, %{service}) %{_sysconfdir}/%{service}/plugins/ml2/sriov_agent.ini
%dir %{_sysconfdir}/%{service}/conf.d/%{service}-sriov-nic-agent %dir %{_sysconfdir}/%{service}/conf.d/%{service}-sriov-nic-agent
%files distributed-traffic
%{python3_sitelib}/openstack-plugin/neutron/%{basename %{SOURCE37}}
%changelog %changelog
* Tue Oct 17 2023 wangkuntian <wangkuntian@uniontech.com> - 15.3.4-3
- Add distributed traffic feature package
* Tue Nov 23 2021 zhangy1317 <zhangy1317@foxmail.com> - 15.3.4-2 * Tue Nov 23 2021 zhangy1317 <zhangy1317@foxmail.com> - 15.3.4-2
- Fix install issue - Fix install issue
* Fri Nov 05 2021 wangxiyuan <wangxiyuan1007@gmail.com> 15.3.4-1 * Fri Nov 05 2021 wangxiyuan <wangxiyuan1007@gmail.com> 15.3.4-1
- Support OpenStack Train release - Support OpenStack Train release