Fix - L3 Conntrack Helper validator

'type:string' is validated by length, the definition was
passing in validators.validate_string instead of a number.
In python3 this causes a TypeError:
 '>' not supported between instances of 'int' and 'function'

Set the length to 64, matching the db model:
https://opendev.org/openstack/neutron/src/branch/master/neutron/db/models/conntrack_helper.py#L32

Related-Bug: #1823633
Change-Id: Idd9b442a30de294ce3fc97069cadba4457d746ab
This commit is contained in:
Harald Jensås 2019-07-18 19:08:51 +02:00
parent 1376d2e807
commit 6d9f9e2841
2 changed files with 9 additions and 2 deletions

View File

@ -15,7 +15,6 @@
from neutron_lib.api import converters
from neutron_lib.api.definitions import l3
from neutron_lib.api import validators
from neutron_lib import constants
from neutron_lib.db import constants as db_const
@ -102,7 +101,7 @@ SUB_RESOURCE_ATTRIBUTE_MAP = {
'is_filter': True},
HELPER: {'allow_post': True, 'allow_put': True,
'convert_to': converters.convert_to_string,
'validate': {'type:string': validators.validate_string},
'validate': {'type:string': 64},
'is_visible': True,
'is_sort_key': True,
'is_filter': True},

View File

@ -0,0 +1,8 @@
---
fixes:
- |
Fixes an issue in the ``l3-conntrack-helper`` API definition. The
validation for the ``helper`` field passed a string validation
method instead of the maximum length of the string. This caused a
TypeError when running under python3.