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:
parent
0088d5be2a
commit
a6a416843a
|
@ -580,6 +580,9 @@ class PolicyClassifier(gbpresource.GBPResource):
|
||||||
'direction', 'shared'
|
'direction', 'shared'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
protocols_list = ['tcp', 'udp', 'icmp', None]
|
||||||
|
protocols_list.extend([str(protocol_num) for protocol_num in range(256)])
|
||||||
|
|
||||||
properties_schema = {
|
properties_schema = {
|
||||||
TENANT_ID: properties.Schema(
|
TENANT_ID: properties.Schema(
|
||||||
properties.Schema.STRING,
|
properties.Schema.STRING,
|
||||||
|
@ -599,7 +602,7 @@ class PolicyClassifier(gbpresource.GBPResource):
|
||||||
properties.Schema.STRING,
|
properties.Schema.STRING,
|
||||||
_('Protocol of traffic described by the policy classifier.'),
|
_('Protocol of traffic described by the policy classifier.'),
|
||||||
constraints=[
|
constraints=[
|
||||||
constraints.AllowedValues(['tcp', 'udp', 'icmp', None])
|
constraints.AllowedValues(protocols_list)
|
||||||
],
|
],
|
||||||
update_allowed=True
|
update_allowed=True
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in New Issue