All of lore.kernel.org
 help / color / mirror / Atom feed
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
Subject: [KVM-AUTOTEST] [PATCH] fix a little problem for kvm_config.py
Date: Tue, 26 May 2009 10:35:35 +0800	[thread overview]
Message-ID: <4A1B5577.7070703@redhat.com> (raw)
In-Reply-To: <587127268.328141243245184536.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>

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


----------------------------------------------------------------------------------------------------------------------------------------
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

  reply	other threads:[~2009-05-26  2:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1818401549.327921243244441830.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>
2009-05-25  9:53 ` [KVM-AUTOTEST] [PATCH] support for remote migration Michael Goldish
2009-05-26  2:35   ` Yolkfull Chow [this message]
2009-06-08  9:43     ` [KVM-AUTOTEST] [PATCH] fix a little problem for kvm_config.py Michael Goldish
2009-05-26  5:18   ` [KVM-AUTOTEST] [PATCH] support for remote migration sudhir kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A1B5577.7070703@redhat.com \
    --to=yzhou@redhat.com \
    --cc=anantyog@linux.vnet.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=smalikphy@gmail.com \
    --cc=uril@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.