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)

pull/25731/head
Thomas Stringer 7 years ago committed by Sam Doran
parent 7eab802669
commit bf63301b34

@ -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']

Loading…
Cancel
Save