Merge pull request #755 from dtenenba/master
bump tag limit from 10 to 50 to align with actual AWS limit
This commit is contained in:
commit
44636d1f73
@ -815,9 +815,9 @@ class TagBackend(object):
|
|||||||
raise InvalidParameterValueErrorTagNull()
|
raise InvalidParameterValueErrorTagNull()
|
||||||
for resource_id in resource_ids:
|
for resource_id in resource_ids:
|
||||||
if resource_id in self.tags:
|
if resource_id in self.tags:
|
||||||
if len(self.tags[resource_id]) + len([tag for tag in tags if not tag.startswith("aws:")]) > 10:
|
if len(self.tags[resource_id]) + len([tag for tag in tags if not tag.startswith("aws:")]) > 50:
|
||||||
raise TagLimitExceeded()
|
raise TagLimitExceeded()
|
||||||
elif len([tag for tag in tags if not tag.startswith("aws:")]) > 10:
|
elif len([tag for tag in tags if not tag.startswith("aws:")]) > 50:
|
||||||
raise TagLimitExceeded()
|
raise TagLimitExceeded()
|
||||||
for resource_id in resource_ids:
|
for resource_id in resource_ids:
|
||||||
for tag in tags:
|
for tag in tags:
|
||||||
|
@ -113,17 +113,9 @@ def test_tag_limit_exceeded():
|
|||||||
conn = boto.connect_ec2('the_key', 'the_secret')
|
conn = boto.connect_ec2('the_key', 'the_secret')
|
||||||
reservation = conn.run_instances('ami-1234abcd')
|
reservation = conn.run_instances('ami-1234abcd')
|
||||||
instance = reservation.instances[0]
|
instance = reservation.instances[0]
|
||||||
tag_dict = {'01': '',
|
tag_dict = {}
|
||||||
'02': '',
|
for i in range(51):
|
||||||
'03': '',
|
tag_dict['{0:02d}'.format(i+1)] = ''
|
||||||
'04': '',
|
|
||||||
'05': '',
|
|
||||||
'06': '',
|
|
||||||
'07': '',
|
|
||||||
'08': '',
|
|
||||||
'09': '',
|
|
||||||
'10': '',
|
|
||||||
'11': ''}
|
|
||||||
|
|
||||||
with assert_raises(EC2ResponseError) as cm:
|
with assert_raises(EC2ResponseError) as cm:
|
||||||
conn.create_tags(instance.id, tag_dict)
|
conn.create_tags(instance.id, tag_dict)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user