Skip to contentSkip to conversation

Fix to allow for "=" in the "value" of a config parameter.

PATCH New Michael Goldish 3 participants 4 messages May 22, 2009 – May 26, 2009 1 message not in the archive KVM

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 558076627.224761242989864526.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com

#1 lore raw

This makes sense, thanks.

One thing though -- I don't know if it's even worth mentioning -- we always try to put a single space after a comma (I think the Python style guide recommends that but I'm not sure). Generally we try to follow the guide (http://www.python.org/dev/peps/pep-0008/) and as far as I know Autotest follows it too.

----- Original Message -----
From: "David Huff" <[email protected]>
To: [email protected]
Cc: "David Huff" <[email protected]>
Sent: Thursday, May 21, 2009 6:36:21 PM (GMT+0200) Auto-Detected
Subject: [PATCH] [KVM_Autotest] Fix to allow for "=" in the "value" of a config parameter.

fix modifies kvm_config.split_and_strip so it will only split once per line.

example: kernel_args = "ks=floppy console=ttyS0 noacpi"

---
 client/tests/kvm_runtest_2/kvm_config.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
client/tests/kvm_runtest_2/kvm_config.py +1 -1
index 4a1e7b4..29a63b7 100755
@@ -94,7 +94,7 @@ class config:
 
     def split_and_strip(self, str, sep="="):
         """Split str and strip quotes from the resulting parts."""
-        temp = str.split(sep)
+        temp = str.split(sep,1)
         for i in range(len(temp)):
             temp[i] = temp[i].strip()
             temp[i] = temp[i].strip("\"\'")
Signature · 6 lines
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
Quoted 4 lines · Michael Goldish

This makes sense, thanks.

One thing though -- I don't know if it's even worth mentioning -- we always try to put a single space after a comma (I think the Python style guide recommends that but I'm not sure). Generally we try to follow the guide (http://www.python.org/dev/peps/pep-0008/) and as far as I know Autotest follows it too.

Strongly agree, Python's syntax allows us to write very pretty code, it makes sense to preserve this.

Signature · 1 line
error compiling committee.c: too many arguments to function
#3 lore raw
Quoted 10 lines · Avi Kivity
Quoted 8 lines · Michael Goldish

This makes sense, thanks.

One thing though -- I don't know if it's even worth mentioning -- we always try to put a single space after a comma (I think the Python style guide recommends that but I'm not sure). Generally we try to follow the guide (http://www.python.org/dev/peps/pep-0008/) and as far as I know Autotest follows it too.

Quoted 3 lines

Strongly agree, Python's syntax allows us to write very pretty code, it makes sense to preserve this.

Thanks for the advice new patch to follow shortly....

-D

#4 lore raw

PATCH 1/1 Fix to allow for "=" in the "value" of a config parameter.

example: kernel_args = "ks=floppy console=ttyS0 noacpi"

fix modifies kvm_config.split_and_strip so it will only split once per line.

---
 client/tests/kvm_runtest_2/kvm_config.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
client/tests/kvm_runtest_2/kvm_config.py +1 -1
index 4a1e7b4..c4fe6ea 100755
@@ -94,7 +94,7 @@ class config:
 
     def split_and_strip(self, str, sep="="):
         """Split str and strip quotes from the resulting parts."""
-        temp = str.split(sep)
+        temp = str.split(sep, 1)
         for i in range(len(temp)):
             temp[i] = temp[i].strip()
             temp[i] = temp[i].strip("\"\'")
Signature · 1 line
1.6.0.6