From patchwork Tue May 26 02:35:35 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yolkfull Chow X-Patchwork-Id: 25903 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4Q2a4gj003401 for ; Tue, 26 May 2009 02:36:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752738AbZEZCgA (ORCPT ); Mon, 25 May 2009 22:36:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752623AbZEZCgA (ORCPT ); Mon, 25 May 2009 22:36:00 -0400 Received: from mx2.redhat.com ([66.187.237.31]:48549 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752049AbZEZCgA (ORCPT ); Mon, 25 May 2009 22:36:00 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n4Q2ZsT5010845; Mon, 25 May 2009 22:35:54 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n4Q2Zr4b011075; Mon, 25 May 2009 22:35:53 -0400 Received: from localhost.localdomain (dhcp-66-70-20.nay.redhat.com [10.66.70.20]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n4Q2ZpNg003736; Mon, 25 May 2009 22:35:51 -0400 Message-ID: <4A1B5577.7070703@redhat.com> Date: Tue, 26 May 2009 10:35:35 +0800 From: Yolkfull Chow User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b5pre) Gecko/20090513 Fedora/3.0-2.4.b3pre.hg.6a6386c16e98.fc11 Thunderbird/3.0b3pre MIME-Version: 1.0 To: kvm@vger.kernel.org CC: sudhir kumar , yogi , Uri Lublin , kvm@vger.kernel.org Subject: [KVM-AUTOTEST] [PATCH] fix a little problem for kvm_config.py References: <587127268.328141243245184536.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> In-Reply-To: <587127268.328141243245184536.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 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