From 53ebe8d441884c4d3e1fca695d30af710015bd53 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Wed, 26 Jul 2017 16:09:31 -0700 Subject: [PATCH] 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 --- lib/ansible/modules/cloud/azure/azure_rm_securitygroup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/azure/azure_rm_securitygroup.py b/lib/ansible/modules/cloud/azure/azure_rm_securitygroup.py index c29b00542f..1957aec0a8 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_securitygroup.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_securitygroup.py @@ -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")