Support protocol numbers in PolicyClassifier

The PolicyClassifier currently only supports the named
protocols of 'icmp', 'tcp', and 'udp'. In order to allow
for the full range of protocols, the constraint validation
needs to be relaxed to support protocol numbers 0-255.

Change-Id: Icd9c442e868339cf845b1255dd6ed3ffe31e85af
This commit is contained in:
Thomas Bachman 2017-06-08 13:57:43 +00:00
parent 52eaab8c9e
commit 7c229a853b
2 changed files with 5 additions and 1 deletions

View File

@ -580,6 +580,9 @@ class PolicyClassifier(gbpresource.GBPResource):
'direction', 'shared'
)
protocols_list = ['tcp', 'udp', 'icmp', None]
protocols_list.extend([str(protocol_num) for protocol_num in range(256)])
properties_schema = {
TENANT_ID: properties.Schema(
properties.Schema.STRING,
@ -599,7 +602,7 @@ class PolicyClassifier(gbpresource.GBPResource):
properties.Schema.STRING,
_('Protocol of traffic described by the policy classifier.'),
constraints=[
constraints.AllowedValues(['tcp', 'udp', 'icmp', None])
constraints.AllowedValues(protocols_list)
],
update_allowed=True
),

View File

@ -12,6 +12,7 @@ kombu>=3.0.25 # BSD
mock>=1.2 # BSD
mox3>=0.7.0 # Apache-2.0
PyMySQL>=0.6.2 # MIT License
oslo.db<4.19.0
oslosphinx!=3.4.0,>=2.5.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0
paramiko>=1.16.0 # LGPL