2217 Commits

Author SHA1 Message Date
elajkat
e1e496d337 Add libczmq4 to bindep for testing on jammy
py310 job is failing for fwaas on jammy, adding libczmq4 to bindep can
solve the issue.

Change-Id: Ie23b9dee179d11cee34f892b9eb86be36d71aab0
2022-07-28 14:51:15 +02:00
zhangtongjian
b126f4224a Remove usage of six
Remove six-library Replace the following items with Python 3 style code.
- six.six.add_metaclass
- six.PY2
- requirement.txt

Change-Id: Ib87394e41cdba7fc57e6ae6ed08ba1f84465441e
2022-07-27 12:46:16 +00:00
Zuul
e4fbbaae08 Merge "Remove usage of six" 2022-06-15 10:43:44 +00:00
Zuul
fa3ee86610 Merge "setup.cfg: Replace dashes with underscores" 2022-06-13 09:57:46 +00:00
sunxifa
b4519b3bbb setup.cfg: Replace dashes with underscores
Setuptools v54.1.0 introduces a warning that the use of
dash-separated options in 'setup.cfg' will not be supported
in a future version [1].
Get ahead of the issue by replacing the dashes with underscores.
Without this, we see 'UserWarning' messages
like the following on new enough
versions of setuptools:

  UserWarning: Usage of dash-separated 'description-file' will not be
  supported in future versions. Please use the underscore name
  'description_file' instead

[1] https://github.com/pypa/setuptools/commit/a2e9ae4cb

Change-Id: If3a6ae3ae3d8d4e87fcb864ba2edf4d1aba6b25e
2022-06-04 09:59:39 +08:00
zhangtongjian
e4555733d4 Remove usage of six
Remove six-library Replace the following items with Python 3 style code.
- six.iteritems
- six.string_types

Change-Id: I102520d28c9189a38cd1760b040eecdd4046b16f
2022-06-03 14:35:43 +08:00
zhouhenglc
64a02d2e98 [doc]remove warning for "deprecate this project"
We have revived the neutron-fwaas project[1], we shoulod remove
the warning in README.rst.

[1] https://review.opendev.org/c/openstack/neutron-fwaas/+/828149

Change-Id: Ib0e091cd594d2344b57c883dd01e1b6e7d7e4bf2
2022-06-03 14:33:21 +08:00
elajkat
b7be99c147 Remove "distutils" library
Library "distutils" will be marked as deprecated in Python 3.10:
https://peps.python.org/pep-0386/

This patch does the following replacements, that provide the same
functionality and API:
- distutils.spawn.find_executable -> shutil.which

Change-Id: Ib9cf36a70b6e5aba93f87e6be5c2636599166de2
Closes-Bug: #1973780
2022-05-24 11:23:35 +02:00
zhouhenglc
ba0a036469 Add the corresponding DB context to all SQL transactions
Neutron code migrated to SQLAlchemy 2.0[1], the goal of this
patch is to make the fwaas plugin code compliant with
SQLAlchemy 2.0.

[1] https://review.opendev.org/c/openstack/neutron/+/833247

Related-Bug: #1964575

Change-Id: If3e996740d4b5024e9c798227d0a58ceb09eb1d6
2022-05-23 08:37:01 +08:00
likui
3bbcc5f8bb Changed minversion in tox to 3.18.0
The patch bumps min version of tox to 3.18.0 in order to
replace tox's whitelist_externals by allowlist_externals option:
https://github.com/tox-dev/tox/blob/master/docs/changelog.rst#v3180-2020-07-23

Change-Id: Ice25307cb403768f3a7909395773ee38154f46ec
2022-05-17 18:36:10 +08:00
Ghanshyam Mann
1b4a84527c Update python testing as per zed cycle teting runtime
In Zed cycle, we have dropped the python 3.6/3.7[1] testing
and its support. Add release notes and update the python
classifier for the same.

[1] https://governance.openstack.org/tc/reference/runtimes/zed.html

Change-Id: Ib04b560408ccf22c86e899e15fbcbe86b53f636e
2022-05-11 22:18:19 -05:00
Zuul
28ba8cc6ca Merge "Fix error when apply rule with dst port large than src port" 2022-05-06 10:45:27 +00:00
Nguyen Thanh Cong
147116b7b1 Fix error when apply rule with dst port large than src port
When apply firewall group to a port with rule have dest port large than
source port, neutron-openvswitch-agent raise error 'port_max' is smaller
than 'port_min'. It because key 'port_range_max' is assigned by
source_port_range_max. Fix hard code 'port_range_max' to key_max.

Change-Id: I32d9efd857932547a13d275b8a4f294e03fe7535
Closes-Bug: #1869121
2022-05-05 02:04:29 +00:00
zhouhenglc
de74e7bbcd Add Python3 zed unit tests
Change-Id: I32f0eaa529038d38aee9fc8ae20292f95bf52ead
2022-05-05 09:27:00 +08:00
shanyunfan33
179019f82e remove unicode from code
remove unicode from code

Change-Id: I3e32aea0439f68e48c6ff178c50e8a91ac5415e4
2022-05-04 23:36:42 +00:00
Ghanshyam Mann
216df5cf82 Drop lower-constraints.txt and its testing
As discussed in TC PTG[1] and TC resolution[2], we are
dropping the lower-constraints.txt file and its testing.
We will keep lower bounds in the requirements.txt file but
with a note that these are not tested lower bounds and we
try our best to keep them updated.

[1] https://etherpad.opendev.org/p/tc-zed-ptg#L326
[2] https://governance.openstack.org/tc/resolutions/20220414-drop-lower-constraints.html#proposal

Change-Id: Icfceba7407e7c775b29e281bdf940653f84f5340
2022-04-30 20:09:59 -05:00
maliangyi
de8a4d4cfb Replace tearDown with addCleanup.
All setUp and tearDown methods must upcall using the super()
method.tearDown methods should be avoided and addCleanup calls
should be preferred[1].

[1] https://github.com/openstack/neutron/blob/master/HACKING.rst

Change-Id: Idef345a44cc9f926c61af342729736d1f9245036
2022-03-21 02:59:36 +00:00
zhouhenglc
3a5dde69e7 Readd neutron-tempest-plugin-fwaas job
Add neutron-tempest-plugin-fwaas job to check and gate pipeline

Change-Id: I7b899deba4e418c70d7234ff18b260eda5c86dbf
2022-03-03 09:53:58 +08:00
ZhouHeng
a9f26b81e2 revive neutron-fwaas project
This reverts commit caae7b6a6f5e8944dbe359b6472be2507bbf5e12.

Reason for revert:
Many users still need L3 firewalls and Inspur team wants to maintain
this project.
Neutron drivers team discussed the topic of the maintenance of
neutron-fwaas, and agreed to include neutron-fwaas again to Neutron
stadium[1].

Some updates have been made:
Remove use "autonested_transaction" method, see more [2]
Replace "neutron_lib.callbacks.registry.notify" with "registry.publish"
Replace rootwrap execution with privsep context execution.
Ensure db Models and migration scripts are sync, set table
firewall_group_port_associations_v2's two columns nullable=False

[1] https://meetings.opendev.org/meetings/neutron_drivers/2022/neutron_drivers.2022-01-28-14.00.log.html#l-14
[2] https://review.opendev.org/c/openstack/neutron-lib/+/761728

Change-Id: I14f551c199d9badcf25b9e65c954c012326d27cd
2022-03-01 01:01:47 +00:00
Ghanshyam Mann
11f0534e8b Moving IRC network reference to OFTC
Change-Id: I13dc29e783697791b4f68dfba88b018c309192c7
2021-07-08 18:44:52 -05:00
Slawek Kaplonski
caae7b6a6f Retire neutron-fwaas project
Governance change is proposed at [1] and project config patch is
proposed at [2]

[1] https://review.opendev.org/735828
[2] https://review.opendev.org/#/c/735812/

Change-Id: I561504160e5548c54d1af31821c3366ab34cf0ec
2020-06-16 12:38:31 +02:00
OpenStack Proposal Bot
94c0d54ded Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: Ifee70c64b57e39214980781ad0d64e7ecdf70eb1
2020-04-16 06:42:10 +00:00
Slawek Kaplonski
5e6c048856 Deprecate neutron-fwaas as stadium project
It's sad but as we still don't have any maintainers for this project,
I think it's time to start process of deprecating this as part of
the Neutron stadium.

Change-Id: I8c8fc6b5ab8a169a0f4a7d77153bb1dfc1530b8e
2020-02-21 16:33:14 +01:00
Zuul
d9ac7173f1 Merge "Drop Python 2 Support" 2020-01-24 00:10:26 +00:00
caoyuan
feb290fa19 Drop Python 2 Support
1. It's Ussuri. We can *finally* stop testing Python 2 [1]. Time to party.
We don't attempt any cleanup but simply stop testing with Python 2,
indicate that we only support Python 3 via 'setup.cfg' and remove any
Python 2 only dependencies.

This should free up a significant amount of resources from the gate and
let us start using Python 3 idioms in our code. Win-win.

2. Cleanup basepython from individual testenv sections

3. From this point on the codebase will be incompatible with python2

[1] https://governance.openstack.org/tc/resolutions/20180529-python2-deprecation-timeline.html#python2-deprecation-timeline

Change-Id: Ia08c363263aaa406d0bf55e10ce8258695387578
2020-01-22 10:53:44 -05:00
Zuul
99fa745980 Merge "Remove os-testr leftovers" 2020-01-14 16:50:24 +00:00
caoyuan
f51b475062 setup.cfg: Cleanup
- pbr hasn't need the hook configuration since forever [1]
- Remove the 'wheel' group

[1] c84876dc0f

Change-Id: Ic448d7d0f4fb906a4ded14aadaf119dce7ab43d7
2020-01-03 01:34:41 +00:00
Slawek Kaplonski
a88d23c797 Remove os-testr leftovers
All projects should be switched to use stestr already. In
neutron-fwaas it is already done but there were some leftovers
after os-testr and this commit removes them.

Change-Id: I7d0c72d1327eedcfd309ec4c346064d0adad6008
2019-11-27 22:30:31 +01:00
zhanghao
330e233a40 Remove fwaas_v1 extensions
There are still related extensions of fwaas_v1 in
neutron-fwaas, it is necessary to remove them because
the fwaas_v1 code has been removed in the Stein cycle[1].

[1] https://review.opendev.org/#/c/616410/
Needed-By: https://review.opendev.org/#/c/692068/
Change-Id: I26d23c74123302ef167bd621acdafd9e0e02c6a0
Closes-bug: #1850602
2019-11-04 08:04:31 -05:00
caoyuan
b767090091 Switch to official Ussuri jobs
Change-Id: I5af5a8109a213e7f7e7cff9fa5e0a1bb637450f9
2019-10-15 10:13:29 +08:00
qinhaizhong01
2b662f05e1 Remove unused import statement.
Change-Id: I2a35a23d02ff08ec4e7fa2396f9a6bedfd01e30f
2019-10-09 21:36:31 -04:00
Zuul
c016427672 Merge "Add format string configuration for FWaaS v2 logging" 2019-10-08 10:42:42 +00:00
Akihiro Motoki
201a2abebe PDF documentation build
The module reference in PDF doc is not easy to read
and the HTML version is much better, so I decided to show
the module reference in HTML doc only.

Change-Id: I914d26ce1b430573020c78af54a38598ae96886b
Story: 2006099
Task: 35129
2019-09-24 16:29:04 +00:00
Yang Youseok
578b12f35e Add 'none' to L3AgentExtensionAPI due to API changes
L3AgentExtensionAPI now takes the new parameter 'router_factory'.
This API change breaks the test cases, so pass None to initialize
the class to aovid the failure.

Depends-On: https://review.openstack.org/#/c/620349/
Change-Id: Iaf3a8071eb6eec8c0c7240d1a0a5d057f7b152d2
2019-09-22 12:05:36 +00:00
Zuul
679bfb772d Merge "Ignore fwg which has no ports when restarting l3-agent" 2019-09-16 09:25:51 +00:00
Zuul
3c9d294471 Merge "Default firewall group rules from configuration file" 2019-09-12 17:22:07 +00:00
David Homolka
f28c59df2b Default firewall group rules from configuration file
Add new options to neutron_fwaas.conf for using in Default firewall group
rules. Separate ingress and egress: action, source ipv4, source ipv6,
source port, destination ipv4, destination ipv6, destination port.
Shared options for ingress and egress: protocol, enabled and shared.

New options are used in _create_default_firewall_rules and default
value are same as before this change, ingress (deny all),
egress (allow all).

Change-Id: Ic48872f3b7dfd4a87065799b7d3656de3d06e4c3
Closes-Bug: #1799358
2019-09-11 11:07:59 +02:00
Zuul
070068941b Merge "Complete move of neutron-fwaas tempest tests to tempest plugin" 2019-08-19 10:26:46 +00:00
Nate Johnston
77e462428e Complete move of neutron-fwaas tempest tests to tempest plugin
As discussed in the neutron_ci meeting [1] the QA team would like to
move the tempest tests for the stadium projects from their repos to
repos specific to being tempest plugins. This is the second part of a two
stage move, by removing the tempest tests that were copied to the
neutron-tempest-plugin repo [2].

[1] http://eavesdrop.openstack.org/meetings/neutron_ci/2019/neutron_ci.2019-03-12-16.01.log.html#l-94
[2] https://etherpad.openstack.org/p/neutron_stadium_move_to_tempest_plugin_repo

Change-Id: If97f3fd7d105f12b69d41017de2d2ed4192ac223
2019-08-16 08:02:44 +00:00
zhanghao2
a7e85121f7 Ignore fwg which has no ports when restarting l3-agent
When restarting l3 agent, it will detect whether the
router is updated. If the port in the firewall group is
not updated, it will also change its status. This patch
skips updating the status of firewall group which has no ports.

Change-Id: Ife294430409a9fb2944917a28a08323f41c89c0d
Closes-Bug:#1783327
2019-07-30 10:01:15 -04:00
Zuul
243a7ef575 Merge "Fix bug when removing a port from the firewall group" 2019-07-23 21:41:04 +00:00
Zuul
e6e5599876 Merge "Add Python 3 Train unit tests" 2019-07-23 21:40:59 +00:00
zhanghao2
3817119959 Fix bug when updating policy in firewall group
When updating only the policy in firewall group, the 'del-port-ids'
and 'add-port-ids' return empty list, which causes the fwg status
to be inactive and iptables in the router namespace are not changed.
This patch fixes the above problem.

Change-Id: I1a4bc0a8258fbbc340825cccb6d287c94304d3c5
Closes-Bug: #1836015
2019-07-23 06:31:53 -04:00
zhanghao2
e3c25d69b5 Add format string configuration for FWaaS v2 logging
If 'local_output_log_base' is specified, logging can use the
'logging_default_format_string' configuration in l3_agent.ini
like ovs firewall log. It can also set the log level based on
whether debug is enabled.

Change-Id: I7f10361b41acf58987399ea9e0c5720a9129a39b
2019-07-18 09:29:33 -04:00
Slawek Kaplonski
e900457cca Switch tempest multinode job to zuulv3 and python3
Old job name was "legacy-neutron-fwaas-v2-dsvm-tempest-multinode",
new name is "neutron-fwaas-v2-dsvm-tempest-multinode"

Change-Id: Ia717bbac366bbd067e65a3895bb2ffb3aded75b7
2019-07-16 12:43:53 +02:00
zhanghao2
90a2707ccf Fix bug when removing a port from the firewall group
When removing a port from the firewall group, the last port is detected as
true or false based on the old port and the new port, but it ignores the
specific number of ports, which causes the fwg status to be inactive regardless
of whether there is a port after the firewall group is reset.

Change-Id: I887e06893f3e11031548767272e95afee40462d8
Closes-Bug: #1817455
2019-07-12 07:30:19 -04:00
Slawek Kaplonski
3b7edce284 Switch functional tests to be run using python3
Change-Id: Ia9daa3e7ed6b690bd168eabceb0a380d351f38bf
2019-07-08 23:20:47 +02:00
Slawek Kaplonski
d3efc3ed55 Fix list_entries for netlink_lib when running on py3
As privsep communicates with main process via socket, data passed
through this socket must be string type in Python 3. This patch
converts bytes to string, then privsep works correctly.

Change-Id: Ia6fa9a230853311849e327029ef7f0ad7d5d0451
2019-07-08 23:19:35 +02:00
Slawek Kaplonski
e351f264ef Migrate functional tests job to zuul v3
Job is also renamed from "legacy-neutron-fwaas-dsvm-functional" to
"neutron-fwaas-functional"

Change-Id: I2c8cef73df67f13e65ce14e6c5f1192a6bb994b0
2019-07-08 12:20:08 +02:00
Corey Bryant
9f990bf566 Add Python 3 Train unit tests
This is a mechanically generated patch to ensure unit testing is in place
for all of the Tested Runtimes for Train.

See the Train python3-updates goal document for details:
https://governance.openstack.org/tc/goals/train/python3-updates.html

Change-Id: I41a3562284d472408cbcfb7f6c3b1d261ea385b0
Story: #2005924
Task: #34225
2019-07-05 13:52:31 -04:00