From bf63301b341ef68abb5c7c0f9d3ae7b475800f48 Mon Sep 17 00:00:00 2001
From: Thomas Stringer
Date: Thu, 20 Jul 2017 11:47:43 -0400
Subject: [PATCH] Fix bug that was uncovered by comparing the port range which
is inherently a string but ansible passes the param in as an implied int if
the range does not contain a non-numeric char (#27017)
---
lib/ansible/modules/cloud/azure/azure_rm_securitygroup.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/ansible/modules/cloud/azure/azure_rm_securitygroup.py b/lib/ansible/modules/cloud/azure/azure_rm_securitygroup.py
index 1831e5e570..d0a7803752 100644
--- a/lib/ansible/modules/cloud/azure/azure_rm_securitygroup.py
+++ b/lib/ansible/modules/cloud/azure/azure_rm_securitygroup.py
@@ -416,12 +416,12 @@ def compare_rules(r, rule):
if rule['protocol'] != r['protocol']:
changed = True
r['protocol'] = rule['protocol']
- if rule['source_port_range'] != r['source_port_range']:
+ if str(rule['source_port_range']) != str(r['source_port_range']):
changed = True
- r['source_port_range'] = rule['source_port_range']
- if rule['destination_port_range'] != r['destination_port_range']:
+ r['source_port_range'] = str(rule['source_port_range'])
+ if str(rule['destination_port_range']) != str(r['destination_port_range']):
changed = True
- r['destination_port_range'] = rule['destination_port_range']
+ r['destination_port_range'] = str(rule['destination_port_range'])
if rule['access'] != r['access']:
changed = True
r['access'] = rule['access']