[master 7/9] Make Blivet.lvs return all LVs not just traditional/thick LVs

vpodzime installerbot-noreply at redhat.com
Fri Jun 12 13:48:50 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/5dd0f6517d7dbce53b68539ace2dddec242fbe9b


More information about the anaconda-patches mailing list