From dcc1e44d8f7a338e1d69d8972e4df4782928f3ab Mon Sep 17 00:00:00 2001 From: Damien Thenot Date: Thu, 4 Apr 2024 14:51:39 +0200 Subject: [PATCH] fix(LargeBlock): removing pv after deletion Signed-off-by: Damien Thenot --- drivers/LargeBlockSR.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/LargeBlockSR.py b/drivers/LargeBlockSR.py index 95842571..a6eaea03 100644 --- a/drivers/LargeBlockSR.py +++ b/drivers/LargeBlockSR.py @@ -72,9 +72,9 @@ def attach(self, sr_uuid): super(LargeBlockSR, self).attach(sr_uuid) def detach(self, sr_uuid): - vg_device = self._get_device() - - self.dconf["device"] = ",".join(vg_device) + if not self.is_deleting: + vg_device = self._get_device() + self.dconf["device"] = ",".join(vg_device) super(LargeBlockSR, self).detach(sr_uuid) if not self.is_deleting: self._destroy_emulated_device() @@ -106,6 +106,8 @@ def delete(self, sr_uuid): finally: self._destroy_emulated_device(base_devices) self.is_deleting = False + for dev in base_devices: + util.pread2(["pvremove", os.path.realpath(dev)]) @deviceCheck def probe(self):