From patchwork Tue Jun 9 00:34:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 28783 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 n590ZCHk011582 for ; Tue, 9 Jun 2009 00:35:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755279AbZFIAfI (ORCPT ); Mon, 8 Jun 2009 20:35:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754962AbZFIAfI (ORCPT ); Mon, 8 Jun 2009 20:35:08 -0400 Received: from mx2.redhat.com ([66.187.237.31]:43871 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754854AbZFIAfG (ORCPT ); Mon, 8 Jun 2009 20:35:06 -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 n590Z9ZB000713; Mon, 8 Jun 2009 20:35:09 -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 n590Z71h011311; Mon, 8 Jun 2009 20:35:08 -0400 Received: from localhost.localdomain (vpn-10-92.bos.redhat.com [10.16.10.92]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n590Yqdt011766; Mon, 8 Jun 2009 20:35:01 -0400 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, Lucas Meneghel Rodrigues , Yolkfull Chow Subject: [KVM-AUTOTEST PATCH 06/06] kvm_config: Make split_and_strip function to strip the right quotes Date: Mon, 8 Jun 2009 21:34:51 -0300 Message-Id: <1244507691-9575-6-git-send-email-lmr@redhat.com> In-Reply-To: <1244507691-9575-5-git-send-email-lmr@redhat.com> References: <1244507691-9575-1-git-send-email-lmr@redhat.com> <1244507691-9575-2-git-send-email-lmr@redhat.com> <1244507691-9575-3-git-send-email-lmr@redhat.com> <1244507691-9575-4-git-send-email-lmr@redhat.com> <1244507691-9575-5-git-send-email-lmr@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 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 --- 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