From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lucas Meneghel Rodrigues 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> 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> Cc: kvm@vger.kernel.org, Lucas Meneghel Rodrigues , Yolkfull Chow To: autotest@test.kernel.org Return-path: 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 In-Reply-To: <1244507691-9575-5-git-send-email-lmr@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 -- 1.6.2.2