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

coerce azure securitygroup priority to int #27354

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/ansible/modules/cloud/azure/azure_rm_securitygroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,11 @@ def validate_rule(rule, rule_type=None):
if not priority:
raise Exception("Rule priority is required.")
if not isinstance(priority, integer_types):
raise Exception("Rule priority attribute must be an integer.")
try:
priority = int(priority)
rule['priority'] = priority
except:
raise Exception("Rule priority attribute must be an integer.")
if rule_type != 'default' and (priority < 100 or priority > 4096):
raise Exception("Rule priority must be between 100 and 4096")

Expand Down