Allow protocol numbers in policy classfiers
Change-Id: Ic09bd459edae1c455d804239584ee9b5d8814a43 Partial-bug: 1499916 (cherry picked from commitab1adfc70d
) (cherry picked from commit3de697f88c
)
This commit is contained in:
@@ -680,8 +680,8 @@ class CreatePolicyClassifier(neutronV20.CreateCommand):
|
||||
help=_('A description for the policy classifier'))
|
||||
parser.add_argument(
|
||||
'--protocol',
|
||||
choices=['tcp', 'udp', 'icmp', ''],
|
||||
help=_('A protocol value. When not set, all protocols are '
|
||||
help=_('A protocol value: tcp, udp, icmp or a protocol number '
|
||||
'between 0 and 255. When not set, all protocols are '
|
||||
'matched'))
|
||||
parser.add_argument(
|
||||
'--port-range',
|
||||
@@ -731,8 +731,8 @@ class UpdatePolicyClassifier(neutronV20.UpdateCommand):
|
||||
help=_('New description for the policy classifier'))
|
||||
parser.add_argument(
|
||||
'--protocol',
|
||||
choices=['tcp', 'udp', 'icmp', ''],
|
||||
help=_('New protocol value '
|
||||
help=_('New protocol value: tcp, udp, icmp or a protocol number '
|
||||
'between 0 and 255 '
|
||||
'(use empty string \'\' to unset and match all protocols)'))
|
||||
parser.add_argument(
|
||||
'--port-range',
|
||||
|
@@ -45,10 +45,10 @@ class CLITestV20PolicyClassifierJSON(test_cli20.CLITestV20Base):
|
||||
tenant_id = 'my-tenant'
|
||||
description = 'My PolicyClassifier'
|
||||
my_id = 'my-id'
|
||||
protocol = 'tcp'
|
||||
port_range = '10-80'
|
||||
direction = 'in'
|
||||
shared = 'true'
|
||||
for protocol in ['tcp', 'icmp', 'udp', '50']:
|
||||
args = ['--tenant-id', tenant_id,
|
||||
'--description', description,
|
||||
'--protocol', protocol,
|
||||
@@ -121,12 +121,12 @@ class CLITestV20PolicyClassifierJSON(test_cli20.CLITestV20Base):
|
||||
|
||||
def test_update_policy_classifier_with_allparams(self):
|
||||
resource = 'policy_classifier'
|
||||
protocol = 'tcp'
|
||||
port_range = '10-80'
|
||||
direction = 'in'
|
||||
cmd = gbp.UpdatePolicyClassifier(test_cli20.MyApp(sys.stdout), None)
|
||||
my_id = 'someid'
|
||||
shared = 'true'
|
||||
for protocol in ['tcp', 'icmp', 'udp', '50']:
|
||||
body = {
|
||||
'protocol': protocol,
|
||||
'port_range': port_range,
|
||||
|
Reference in New Issue
Block a user