Message ID | 1771812210.1409891244454198038.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/client/tests/kvm_runtest_2/kvm_config.py b/client/tests/kvm_runtest_2/kvm_config.py index 4a1e7b4..dd43bd1 100755 --- a/client/tests/kvm_runtest_2/kvm_config.py +++ b/client/tests/kvm_runtest_2/kvm_config.py @@ -97,7 +97,10 @@ class config: temp = str.split(sep) 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 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org
Looks good to me -- thanks. ----- Original Message ----- From: "Yolkfull Chow" <yzhou@redhat.com> To: kvm@vger.kernel.org Cc: "sudhir kumar" <smalikphy@gmail.com>, "yogi" <anantyog@linux.vnet.ibm.com>, "Uri Lublin" <uril@redhat.com>, kvm@vger.kernel.org Sent: Tuesday, May 26, 2009 5:35:35 AM (GMT+0200) Auto-Detected Subject: [KVM-AUTOTEST] [PATCH] fix a little problem for kvm_config.py Hi Everyone: I would submit a little patch for kvm_config.py. Since I found if a string contains a pair of '"' or "'", and one of the pair is at the end of the string, such as: 'systeminfo^ | find "Memory"' ( which is used to catch memory of windows ), the quotation mark at the end of the string will be stripped whereas another will not. That is to say, if we use only this clause : temp[i] = temp[i].strip("\"\'") , the string above will be stripped to be: systeminfo^ | find "Memory . So I would suggest we only strip the quotation marks that existing at both the beginning and the end of the string. Any comments/criticism will be high appreciated. Thanks & Regards, Yingfu ---------------------------------------------------------------------------------------------------------------------------------------- More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html