[PATCH 3/5] Don't split values for keys including MODEL or VENDOR.

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

 



Unfortunately, these values are not necessarily enclosed in quotes but
could still include spaces.  We don't want the values in our results hash
to be lists, so we need to skip splitting for some keys.
---
 storage/udev.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/storage/udev.py b/storage/udev.py
index b6f6643..24b86be 100644
--- a/storage/udev.py
+++ b/storage/udev.py
@@ -170,7 +170,9 @@ def udev_parse_block_entry(buf):
                 if not sep:
                     continue
 
-                if var_val.count(" "):
+                # Skip splitting for any keys matching MODEL or VENDOR, since
+                # those values could include embedded, unquoted spaces.
+                if var_val.count(" ") and var_name.find("MODEL") == -1 and var_name.find("VENDOR") == -1:
                     # eg: DEVLINKS
                     var_val = var_val.split()
 
-- 
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