Skip to content

Commit

Permalink
Make sure we don't enter an infinite retry loop on sym dev delete
Browse files Browse the repository at this point in the history
If a sym dev is a snapvx source, it can't be deleted. So we need to
detect this case and not enter the normal retry loop, whose purpose is
to wait for freed condition.
  • Loading branch information
cvaroqui committed Oct 13, 2022
1 parent f6ebf93 commit 08b067a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion opensvc/drivers/array/symmetrix.py
Expand Up @@ -1209,6 +1209,11 @@ def del_disk(self, dev=None, **kwargs):
except ex.Error as exc:
self.log.info("rdf data: %s", exc)
rdf_data = None
data = self.get_sym_dev_show(dev)
if len(data) != 1:
raise ex.Error("dev %s does not exist" % dev)
if data[0].get("Dev_Info", {}).get("snapvx_source") == "True":
raise ex.Error("dev %s is a snapvx_source. can not delete" % dev)
self.set_dev_ro(dev)
self.del_map(dev)
self.deletepair(dev)
Expand All @@ -1221,7 +1226,7 @@ def del_disk(self, dev=None, **kwargs):
except ex.Error as exc:
if "A free of all allocations is required" in str(exc):
if retry == 1:
raise ex.Error("dev %s is still not free of all allocations after 5 tries")
raise ex.Error("dev %s is still not free of all allocations after 5 tries" % dev)
# retry
retry -= 1
time.sleep(5)
Expand Down

0 comments on commit 08b067a

Please sign in to comment.