Acked-by: Ariel Tubaltsev <atubalts...@vmware.com>
On 9/19/14 7:29 AM, "Gurucharan Shetty" <shet...@nicira.com> wrote: >string.split() function splits a quoted string if there is a whitespace >inside the quote. >ex: The following code snippet will output ['printing', '"No', >'Diagnostic"'] >args = 'printing "No Diagnostic"' >print args.split() > >The above is a problem if we run the following command through vtep_ctl(). >vtep-ctl set tunnel $uuid bfd_status:diagnostic="No Diagnostic" > >The workaround is to use the split() function from shlex module. > >Signed-off-by: Gurucharan Shetty <gshe...@nicira.com> >--- > vtep/ovs-vtep | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > >diff --git a/vtep/ovs-vtep b/vtep/ovs-vtep >index c70ed64..0b855bb 100755 >--- a/vtep/ovs-vtep >+++ b/vtep/ovs-vtep >@@ -18,6 +18,7 @@ > > import argparse > import re >+import shlex > import subprocess > import sys > import time >@@ -55,13 +56,13 @@ def call_prog(prog, args_list): > return output > > def ovs_vsctl(args): >- return call_prog("ovs-vsctl", args.split()) >+ return call_prog("ovs-vsctl", shlex.split(args)) > > def ovs_ofctl(args): >- return call_prog("ovs-ofctl", args.split()) >+ return call_prog("ovs-ofctl", shlex.split(args)) > > def vtep_ctl(args): >- return call_prog("vtep-ctl", args.split()) >+ return call_prog("vtep-ctl", shlex.split(args)) > > > def unixctl_exit(conn, unused_argv, unused_aux): >-- >1.7.9.5 > >_______________________________________________ >dev mailing list >dev@openvswitch.org >https://urldefense.proofpoint.com/v1/url?u=http://openvswitch.org/mailman/ >listinfo/dev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=MV0ainYANUJshevWnic4Bqj >PTBitdF4sSVi8%2ByXyTlU%3D%0A&m=BS3IuyusW3USNq7WrcqHHUW1tuZ%2FBmVwInNmddZnb >xM%3D%0A&s=bbbb9a71abac78f7d502d222588e86cc091cb15e3dbc2d2c81f329720f2ff3e >1 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev