Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to create an any to any firewall rule #19

Merged
merged 1 commit into from
Sep 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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