summaryrefslogtreecommitdiffstats
path: root/pyanaconda/pyudev.py
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2010-06-02 17:42:01 +0200
committerHans de Goede <hdegoede@redhat.com>2010-06-02 17:55:31 +0200
commit88f8041e8afc8e30351d952a4d9af0ddcb67a221 (patch)
treefcce87eb2b1e303ec4a3096c62ba67b4edb3e297 /pyanaconda/pyudev.py
parentd3e968673db43b6d825a3f25277348f9763717cd (diff)
downloadanaconda-88f8041e8afc8e30351d952a4d9af0ddcb67a221.tar.gz
anaconda-88f8041e8afc8e30351d952a4d9af0ddcb67a221.tar.xz
anaconda-88f8041e8afc8e30351d952a4d9af0ddcb67a221.zip
Fix backtrace when a vg starts with freespace (#597925)
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.
Diffstat (limited to 'pyanaconda/pyudev.py')
-rw-r--r--pyanaconda/pyudev.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/pyanaconda/pyudev.py b/pyanaconda/pyudev.py
index e51ee33fc..4b5d586ca 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)