diff options
author | Lingxian Kong <anlin.kong@gmail.com> | 2020-03-17 14:20:52 +1300 |
---|---|---|
committer | Lingxian Kong <anlin.kong@gmail.com> | 2020-03-17 14:20:52 +1300 |
commit | 513e0dd3cd27790718b31c6d0d4b556bd6de0793 (patch) | |
tree | 09b5ada692a39fd0639d57bb1d27f63c322ee118 | |
parent | c952838a9bbd8a5e67d64dc3271501341fdd2394 (diff) | |
download | trove-513e0dd3cd27790718b31c6d0d4b556bd6de0793.tar.gz |
Delete error volumes when deleting instance
Backport candidate.
Change-Id: I799f7b30e1af396a8ae540cff2ba8b548a23f82c
Story: 2007436
Task: 39083
-rw-r--r-- | trove/instance/models.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/trove/instance/models.py b/trove/instance/models.py index fd2b935b..99cf7706 100644 --- a/trove/instance/models.py +++ b/trove/instance/models.py @@ -789,7 +789,9 @@ class BaseInstance(SimpleInstance): try: if self.volume_id: volume = self.volume_client.volumes.get(self.volume_id) - if volume.status == "available": + if volume.status in ["available", "error"]: + LOG.info("Deleting volume %s for instance %s", + self.volume_id, self.id) volume.delete() except Exception as e: LOG.warning("Failed to delete volume for instance %s, error: %s", |