Skip to content

Commit

Permalink
Fix disable vvold integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
mariolenz committed Sep 19, 2022
1 parent 6c70a35 commit 6e77204
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions plugins/modules/vmware_host_firewall_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,20 +264,19 @@ def check_params(self):
self.module.fail_json(msg="Please specify rules.enabled for rule set"
" %s as it is required parameter." % rule_name)

allowed_hosts = rule_option.get('allowed_hosts', {})
ip_addresses = allowed_hosts.get('ip_address')
ip_networks = allowed_hosts.get('ip_network')
for ip_address in ip_addresses:
try:
is_ipaddress(ip_address)
except ValueError:
self.module.fail_json(msg="%s is not a valid IP." % ip_address)

for ip_network in ip_networks:
try:
is_ipaddress(ip_network)
except ValueError:
self.module.fail_json(msg="%s is not a valid network" % ip_network)
allowed_hosts = rule_option.get('allowed_hosts')
if allowed_hosts is not None:
for ip_address in allowed_hosts.get('ip_address'):
try:
is_ipaddress(ip_address)
except ValueError:
self.module.fail_json(msg="%s is not a valid IP." % ip_address)

for ip_network in allowed_hosts.get('ip_network'):
try:
is_ipaddress(ip_network)
except ValueError:
self.module.fail_json(msg="%s is not a valid network" % ip_network)

def ensure(self):
"""
Expand Down

0 comments on commit 6e77204

Please sign in to comment.