if we are trying to add the same rule then we are already in the desired state, return true

This commit is contained in:
Banio Carpenter 2018-05-07 16:04:28 -05:00
parent e9c1723175
commit dcc35df489

View file

@ -476,6 +476,9 @@ def authorize(name=None, source_group_name=None,
log.error(msg)
return False
except boto.exception.EC2ResponseError as e:
# if we are trying to add the same rule then we are already in the desired state, return true
if e.error_code == 'InvalidPermission.Duplicate':
return True
msg = ('Failed to add rule to security group {0} with id {1}.'
.format(group.name, group.id))
log.error(msg)