Fix Cloudformation delete stack implementation (#6123)
This commit is contained in:
parent
a4fe80d274
commit
d07b50f755
@ -346,10 +346,10 @@ class FakeStackInstances(BaseModel):
|
|||||||
instance.parameters = parameters or []
|
instance.parameters = parameters or []
|
||||||
|
|
||||||
def delete(self, accounts: List[str], regions: List[str]) -> None:
|
def delete(self, accounts: List[str], regions: List[str]) -> None:
|
||||||
for i, instance in enumerate(self.stack_instances):
|
for instance in self.stack_instances:
|
||||||
if instance.region_name in regions and instance.account_id in accounts:
|
if instance.region_name in regions and instance.account_id in accounts:
|
||||||
instance.delete()
|
instance.delete()
|
||||||
self.stack_instances.pop(i)
|
self.stack_instances.remove(instance)
|
||||||
|
|
||||||
def get_instance(self, account: str, region: str) -> FakeStackInstance: # type: ignore[return]
|
def get_instance(self, account: str, region: str) -> FakeStackInstance: # type: ignore[return]
|
||||||
for i, instance in enumerate(self.stack_instances):
|
for i, instance in enumerate(self.stack_instances):
|
||||||
|
Loading…
Reference in New Issue
Block a user