[PATCH 02/14] Make sure sizes contains only floats in udev_device_get_lv_sizes()

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

 



info['LVM2_LV_SIZE'] may contain some entries that are shell
variable syntax, so strip the variable name and equal sign
when building the sizes list.
---
 storage/udev.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/storage/udev.py b/storage/udev.py
index 4f83c2a..d0cf6fb 100644
--- a/storage/udev.py
+++ b/storage/udev.py
@@ -262,12 +262,17 @@ def udev_device_get_lv_uuids(info):
 def udev_device_get_lv_sizes(info):
     # lvm's decmial precision is not configurable, so we tell it to use
     # KB and convert to MB here
+    def _splitVar(var):
+        lst = var.split('=')
+        return lst[len(lst) - 1]
+
     sizes = info['LVM2_LV_SIZE']
     if not sizes:
         sizes = []
     elif not isinstance(sizes, list):
         sizes = [sizes]
 
+    sizes = map(lambda s: _splitVar(s), sizes)
     return [float(s) / 1024 for s in sizes]
 
 
-- 
1.6.1.3

_______________________________________________
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