From 5a6e468093c2fbdf85714320a6575d6c4b5af8f8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 29 Jan 2025 22:48:15 +0100 Subject: [PATCH] Revert "Fix LVHDSR.load: test other_conf to prevent mypy error" This reverts commit 85b9b23330607ecc90ff0d7301ee07565ef301cb. --- drivers/LVHDSR.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/LVHDSR.py b/drivers/LVHDSR.py index c5ed1907..66f9aac0 100755 --- a/drivers/LVHDSR.py +++ b/drivers/LVHDSR.py @@ -166,9 +166,11 @@ def load(self, sr_uuid) -> None: self.mdpath = os.path.join(self.path, self.MDVOLUME_NAME) self.provision = self.PROVISIONING_DEFAULT - self.other_conf = None - if self.srcmd.params.get("sr_ref"): + has_sr_ref = self.srcmd.params.get("sr_ref") + if has_sr_ref: self.other_conf = self.session.xenapi.SR.get_other_config(self.sr_ref) + else: + self.other_conf = None self.lvm_conf = None if self.other_conf: @@ -181,7 +183,7 @@ def load(self, sr_uuid) -> None: opterr='Failed to initialise the LVMCache') self.lvActivator = LVActivator(self.uuid, self.lvmCache) self.journaler = Journaler(self.lvmCache) - if not self.other_conf: + if not has_sr_ref: return # must be a probe call # Test for thick vs thin provisioning conf parameter if 'allocation' in self.dconf: