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)

This commit is contained in:
Thomas Stringer 2017-07-20 11:47:43 -04:00 committed by Sam Doran
commit bf63301b34

View file

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