Merge "Fix a bug firewall rule creation fails with ANY protocol"
This commit is contained in:
@@ -46,7 +46,7 @@ class AddRuleAction(workflows.Action):
|
|||||||
choices=[('tcp', _('TCP')),
|
choices=[('tcp', _('TCP')),
|
||||||
('udp', _('UDP')),
|
('udp', _('UDP')),
|
||||||
('icmp', _('ICMP')),
|
('icmp', _('ICMP')),
|
||||||
(None, _('ANY'))],)
|
('any', _('ANY'))],)
|
||||||
action = forms.ChoiceField(
|
action = forms.ChoiceField(
|
||||||
label=_("Action"),
|
label=_("Action"),
|
||||||
choices=[('allow', _('ALLOW')),
|
choices=[('allow', _('ALLOW')),
|
||||||
@@ -95,6 +95,8 @@ class AddRuleStep(workflows.Step):
|
|||||||
def contribute(self, data, context):
|
def contribute(self, data, context):
|
||||||
context = super(AddRuleStep, self).contribute(data, context)
|
context = super(AddRuleStep, self).contribute(data, context)
|
||||||
if data:
|
if data:
|
||||||
|
if context['protocol'] == 'any':
|
||||||
|
del context['protocol']
|
||||||
for field in ['source_port',
|
for field in ['source_port',
|
||||||
'destination_port',
|
'destination_port',
|
||||||
'source_ip_address',
|
'source_ip_address',
|
||||||
|
Reference in New Issue
Block a user