Disable port number 0 for floating IP port_forwarding

Floating IP port forwarding internal or external port number should
not allow 0, otherwise you will get some ValueError exception in
neutron server.

Directly modify the floating-ip-port-forwarding extension to change
the external_port and internal_port minimum value.

Change-Id: Icb177932f6cf1262757b29cb9b997321704616b7
Closes-Bug: #1799150
This commit is contained in:
LIU Yulong 2018-10-26 19:40:15 +08:00
parent 987fc92fef
commit 8dc31ec5f2
2 changed files with 12 additions and 2 deletions

View File

@ -91,13 +91,15 @@ SUB_RESOURCE_ATTRIBUTE_MAP = {
'is_visible': False},
EXTERNAL_PORT: {
'allow_post': True, 'allow_put': True,
'validate': {'type:port_range': None},
'convert_to': converters.convert_to_int,
'validate': {'type:range': [1, 65535]},
'is_visible': True,
'is_sort_key': True,
'is_filter': True},
INTERNAL_PORT: {
'allow_post': True, 'allow_put': True,
'validate': {'type:port_range': None},
'convert_to': converters.convert_to_int,
'validate': {'type:range': [1, 65535]},
'is_visible': True},
INTERNAL_IP_ADDRESS: {'allow_post': True,
'allow_put': True,

View File

@ -0,0 +1,8 @@
---
fixes:
- |
Neutron API should not allow user to set zero for floating IP port
forwarding internal or external port number. Directly modify the
floating-ip-port-forwarding extension to change external_port and
internal_port minimum value to 1. Then API and port forwarding object
will make consistent for these attributes.