Skip to content

Commit

Permalink
Allow to create an any to any firewall rule (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmazzuola authored Sep 6, 2021
1 parent 6bfcfd5 commit b34cad0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyvcloud/vcd/firewall_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ def _populate_objects_info(self, firewall_rule_temp, values, type):
:param str type: type. e.g., source, destination
"""
for value in values:
if value == 'any':
continue
values_arr = value.split(':')
object_type = values_arr[1]
object = values_arr[0]
Expand Down
25 changes: 25 additions & 0 deletions system_tests/firewall_rule_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,31 @@ def test_0050_edit(self):
firewall_obj.edit(source_object, destination_object, source,
TestFirewallRules._firewall_rule_name)

def test_0051_edit_from_any_to_any(self):
firewall_obj = FirewallRule(TestFirewallRules._org_client,
TestFirewallRules._name,
TestFirewallRules._rule_id)
source_object = [
'any'
]
destination_object = [
'any'
]
source = [{
'tcp': {
'any': 'any'
}
}, {
'icmp': {
'any': 'any'
}
}, {
'any': {
'any': 'any'
}
}]
firewall_obj.edit(source_object, destination_object, source, TestFirewallRules._name)

def test_0041_enable_disable_firewall_rule(self):
firewall_obj = FirewallRule(TestFirewallRules._org_client,
TestFirewallRules._name,
Expand Down

0 comments on commit b34cad0

Please sign in to comment.