Yeela Kaplan has uploaded a new change for review.

Change subject: Handle spaces in device names using lvm filter
......................................................................

Handle spaces in device names using lvm filter

Change-Id: I1efb6dfd30c0999f14c413fff778213b247a178f
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=819745
Signed-off-by: Yeela Kaplan <[email protected]>
---
M vdsm/storage/lvm.py
1 file changed, 8 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/91/9191/1

diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
index e846e38..16c2c44 100644
--- a/vdsm/storage/lvm.py
+++ b/vdsm/storage/lvm.py
@@ -130,11 +130,16 @@
 def _buildFilter(devList):
     devList = list(devList)
     devList.sort()
-    filt = '|'.join(dev.strip() for dev in devList if dev.strip())
+    devs = []
+    for dev in devList:
+        if dev.strip():
+            devs.append('\\\\\\\\x20'.join(dev.strip().
+                            encode("string_escape").split()))
+    filt = '|'.join(devs)
     if len(filt) > 0:
-        filt = '"a%' + filt + '%", '
+        filt = "'a%" + filt + "%', "
 
-    filt = 'filter = [ ' + filt + '"r%.*%" ]'
+    filt = "filter = [ " + filt + "'r%.*%' ]"
     return filt
 
 


--
To view, visit http://gerrit.ovirt.org/9191
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1efb6dfd30c0999f14c413fff778213b247a178f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to