kvm_config: Make split_and_strip function to strip the right quotes
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@redhat.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@3250 592f7852-d20e-0410-864c-8624ca9c26a4
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 @@
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