mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
Fix for validate rule. Ensure rule is a dict. (#4640)
This commit is contained in:
@@ -167,6 +167,10 @@ def validate_rule(module, rule):
|
||||
VALID_PARAMS = ('cidr_ip',
|
||||
'group_id', 'group_name', 'group_desc',
|
||||
'proto', 'from_port', 'to_port')
|
||||
|
||||
if not isinstance(rule, dict):
|
||||
module.fail_json(msg='Invalid rule parameter type [%s].' % type(rule))
|
||||
|
||||
for k in rule:
|
||||
if k not in VALID_PARAMS:
|
||||
module.fail_json(msg='Invalid rule parameter \'{}\''.format(k))
|
||||
|
||||
Reference in New Issue
Block a user