coerce azure securitygroup priority to int (#27354)

* fixes #22686
* would be better served in the future by using subspec, but it's in too much flux right now
This commit is contained in:
Matt Davis 2017-07-26 16:09:31 -07:00 committed by GitHub
parent bfdf85e002
commit 53ebe8d441

View file

@ -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")