[PATCH] Fix backtrace when a vg starts with freespace (#597925)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When a vg starts with freespace lvm pvs -olv_name,lv_uuid,.... outputs
an empty name for the freespace "lv", our lvm lv value splitting code
could not handle it when there was an empty value at the beginning of
a lv value list, this patch fixes this.
---
 pyanaconda/pyudev.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/pyanaconda/pyudev.py b/pyanaconda/pyudev.py
index e51ee33..4b5d586 100644
--- a/pyanaconda/pyudev.py
+++ b/pyanaconda/pyudev.py
@@ -145,8 +145,13 @@ class UdevDevice(dict):
             name = libudev_udev_list_entry_get_name(property_entry)
             value = libudev_udev_list_entry_get_value(property_entry)
 
-            # XXX some of the strings contain a list of values in them,
+            # lvm outputs values for multiple lvs in one line
             # we want to split them and make a list
+            # if the first lv's value is empty we end up with a value starting
+            # with name=, prepend a space that our split does the right thing
+            if value.startswith("%s=" % name):
+                value = " " + value
+
             if value.count(" %s=" % name):
                 value = value.split(" %s=" % name)
 
-- 
1.7.0.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux