[master 7/9] Make Blivet.lvs return all LVs not just traditional/thick LVs
vpodzime
installerbot-noreply at redhat.com
Thu Jun 18 20:00:36 UTC 2015
From: Vratislav Podzimek <vpodzime at redhat.com>
Thin pools and thin LVs are also LVs so they should be included in the
result. Also don't use the to-be-deprecated-soon getDevicesByType() method.
---
blivet/blivet.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/blivet/blivet.py b/blivet/blivet.py
index 6a322b1..306a479 100644
--- a/blivet/blivet.py
+++ b/blivet/blivet.py
@@ -408,9 +408,8 @@ def lvs(self):
does not necessarily reflect the actual on-disk state of the
system's disks.
"""
- lvs = self.devicetree.getDevicesByType("lvmlv")
- lvs.sort(key=lambda d: d.name)
- return lvs
+ lvs = (d for d in self.devices if d.type in ("lvmlv", "lvmthinpool", "lvmthinlv"))
+ return sorted(lvs, key=lambda d: d.name)
@property
def thinlvs(self):
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/5903e71e1aca47815bbc848865289e2e0e7be4f9
More information about the anaconda-patches
mailing list