Fix Cloudformation delete stack implementation (#6123)

This commit is contained in:
Priya M 2023-03-30 07:53:30 +11:00 committed by GitHub
parent a4fe80d274
commit d07b50f755
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -346,10 +346,10 @@ class FakeStackInstances(BaseModel):
instance.parameters = parameters or []
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:
instance.delete()
self.stack_instances.pop(i)
self.stack_instances.remove(instance)
def get_instance(self, account: str, region: str) -> FakeStackInstance: # type: ignore[return]
for i, instance in enumerate(self.stack_instances):