Skip to content

Commit

Permalink
Revert "Fix LVHDSR.load: test other_conf to prevent mypy error"
Browse files Browse the repository at this point in the history
This reverts commit 85b9b23.
  • Loading branch information
Wescoeur committed Jan 29, 2025
1 parent a574fcc commit 5a6e468
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/LVHDSR.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 5a6e468

Please sign in to comment.