Raise a client error if PutBucketTags request contains duplicate keys

A PutBucketTags request with duplicate keys will raise a ClientError
with code InvalidTag and message 'Cannot provide multiple Tags with the
same key'.
This commit is contained in:
Jon Michaelchuck 2018-11-26 15:56:46 -08:00
commit 009b02bcd5
3 changed files with 31 additions and 1 deletions

View file

@ -178,3 +178,12 @@ class InvalidStorageClass(S3ClientError):
"InvalidStorageClass",
"The storage class you specified is not valid",
*args, **kwargs)
class DuplicateTagKeys(S3ClientError):
code = 400
def __init__(self, *args, **kwargs):
super(DuplicateTagKeys, self).__init__(
"InvalidTag",
"Cannot provide multiple Tags with the same key",
*args, **kwargs)