[KVM-AUTOTEST PATCH 06/06] kvm_config: Make split_and_strip function to strip the right quotes

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

 



In some occasions, the current logic to strip quotest from config
parameters might remove valid quotes from the params. This patch
fixes this problem.

Signed-off-by: Yolkfull Chow <yzhou@xxxxxxxxxx>
---
 client/tests/kvm/kvm_config.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/client/tests/kvm/kvm_config.py b/client/tests/kvm/kvm_config.py
index 40f16f1..5d9b69e 100755
--- a/client/tests/kvm/kvm_config.py
+++ b/client/tests/kvm/kvm_config.py
@@ -139,7 +139,10 @@ class config:
         temp = str.split(sep, 1)
         for i in range(len(temp)):
             temp[i] = temp[i].strip()
-            temp[i] = temp[i].strip("\"\'")
+            if re.findall("^\".*\"$", temp[i]):
+                temp[i] = temp[i].strip("\"")
+            elif re.findall("^\'.*\'$", temp[i]):
+                temp[i] = temp[i].strip("\'")
         return temp
 
 
-- 
1.6.2.2

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux