implement target group tagging
This commit is contained in:
parent
35feb9feb7
commit
4b7a157560
3 changed files with 51 additions and 21 deletions
|
|
@ -65,6 +65,7 @@ class FakeTargetGroup(BaseModel):
|
|||
self.healthy_threshold_count = healthy_threshold_count
|
||||
self.unhealthy_threshold_count = unhealthy_threshold_count
|
||||
self.load_balancer_arns = []
|
||||
self.tags = {}
|
||||
|
||||
self.attributes = {
|
||||
'deregistration_delay.timeout_seconds': 300,
|
||||
|
|
@ -86,6 +87,11 @@ class FakeTargetGroup(BaseModel):
|
|||
if not t:
|
||||
raise InvalidTargetError()
|
||||
|
||||
def add_tag(self, key, value):
|
||||
if len(self.tags) >= 10 and key not in self.tags:
|
||||
raise TooManyTagsError()
|
||||
self.tags[key] = value
|
||||
|
||||
def health_for(self, target):
|
||||
t = self.targets.get(target['id'])
|
||||
if t is None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue