Merge pull request #47525 from baniobloom/duplicate_sec_group_rule

Trying to add a duplicate sec group rule true
This commit is contained in:
Nicole Thomas 2018-05-22 10:51:08 -04:00 committed by GitHub
commit 9c5dde1449
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)