Re: [ovs-dev] [PATCH] ovn-ctl: Handle whitespaces when using eval for start_ovsdb:

2018-04-28 Thread aginwala
Sure Ben. As you said that would be better and I thought you meant you were fine by dropping local too. Sorry for the confusion. I have revised v4 with local and have sent it out @https://patchwork.ozlabs.org/patch/906237/ . Also tested the same and works fine. Please let me know if you need

Re: [ovs-dev] [PATCH] ovn-ctl: Handle whitespaces when using eval for start_ovsdb:

2018-04-28 Thread Ben Pfaff
Thanks for the revision. As I said before, I think that we should separate "local" from "eval" rather than dropping it, in other words change all instances of eval local x=... to local x; eval x=... Thanks, Ben. On Sat, Apr 28, 2018 at 06:21:31PM -0700, aginwala wrote: > Thanks

Re: [ovs-dev] [PATCH] ovn-ctl: Handle whitespaces when using eval for start_ovsdb:

2018-04-28 Thread aginwala
Thanks Ben: Sounds good. As suggested, I have included other variables as it completely makes sense to tackle them too. Have sent the revised v3 @ https://patchwork.ozlabs.org/patch/906235/. Have tested the same and it works as expected. Regards, Aliasgar On Sat, Apr 28, 2018 at 3:21 PM, Ben

[ovs-dev] [PATCH] ovn-ctl: Handle whitespaces when using eval for start_ovsdb:

2018-04-28 Thread aginwala
eval doesn't understand white space for local var which was introduced in commit 79c7961b8b3c4b7ea0251dea2ffacfa84c84fecb for starting clustered ovn dbs. As ovn-ctl uses sh instead of bash, parsing local var with white space will fail. e.g. /usr/share/openvswitch/scripts/ovn-ctl

Re: [ovs-dev] [PATCH] ovn-ctl: Handle whitespaces when using eval for start_ovsdb:

2018-04-28 Thread Ben Pfaff
I think that just drops the "local" instead of separating it. I think that would be better. I also think that we should do it for each "local" rather than just for a single one, because it's hard to guess whether some other variable might have a space in it. Thanks, Ben. On Sat, Apr 28, 2018

Re: [ovs-dev] [PATCH] ovn-ctl: Handle whitespaces when using eval for start_ovsdb:

2018-04-28 Thread aginwala
Yes: I already have sent the patch with this changes in v2 @ https://patchwork.ozlabs.org/patch/904894/ Please help review and merge the same. :) Regards, Aliasgar On Sat, Apr 28, 2018 at 11:57 AM, Ben Pfaff wrote: > OK, after experimenting, it looks to me like a good way to

Re: [ovs-dev] [PATCH] ovn-ctl: Handle whitespaces when using eval for start_ovsdb:

2018-04-28 Thread Ben Pfaff
OK, after experimenting, it looks to me like a good way to avoid this problem is to change all instances of eval local x=... to local x; eval x=... That seems to work with both bash and dash, and avoids expanding the scope of the local variables. Does that solve the problem for

Re: [ovs-dev] [PATCH] ovn-ctl: Handle whitespaces when using eval for start_ovsdb:

2018-04-25 Thread aginwala
It's dash root@test3:~# ls -l /bin/sh lrwxrwxrwx 1 root root 4 Feb 17 2016 /bin/sh -> dash Regards, On Wed, Apr 25, 2018 at 6:24 PM, Ben Pfaff wrote: > On April 25, 2018 8:51:01 PM EDT, aginwala wrote: >> >> The root cause is ovn-ctl is using sh instead of

Re: [ovs-dev] [PATCH] ovn-ctl: Handle whitespaces when using eval for start_ovsdb:

2018-04-25 Thread Ben Pfaff
On April 25, 2018 8:51:01 PM EDT, aginwala wrote: >The root cause is ovn-ctl is using sh instead of bash. Parsing works >fine >if we use bash > >e.g below is the comparision: >root@test3:~# cat test.sh >#!/bin/bash >aaa="-vconsole:off -vfile:info" >test(){ >c="a" >eval local

Re: [ovs-dev] [PATCH] ovn-ctl: Handle whitespaces when using eval for start_ovsdb:

2018-04-25 Thread aginwala
The root cause is ovn-ctl is using sh instead of bash. Parsing works fine if we use bash e.g below is the comparision: root@test3:~# cat test.sh #!/bin/bash aaa="-vconsole:off -vfile:info" test(){ c="a" eval local x=\$a${c}a echo 'log values are '$x } root@test3:~# ./test.sh log values are

Re: [ovs-dev] [PATCH] ovn-ctl: Handle whitespaces when using eval for start_ovsdb:

2018-04-25 Thread aginwala
On Wed, Apr 25, 2018 at 12:54 PM, Ben Pfaff wrote: > On Thu, Apr 12, 2018 at 03:40:33PM -0700, aginwala wrote: > > eval doesn't understand white spaces which was introduced in commit > > 79c7961b8b3c4b7ea0251dea2ffacfa84c84fecb for starting clustered ovn dbs > > > > Hence, we need

Re: [ovs-dev] [PATCH] ovn-ctl: Handle whitespaces when using eval for start_ovsdb:

2018-04-25 Thread Ben Pfaff
On Thu, Apr 12, 2018 at 03:40:33PM -0700, aginwala wrote: > eval doesn't understand white spaces which was introduced in commit > 79c7961b8b3c4b7ea0251dea2ffacfa84c84fecb for starting clustered ovn dbs > > Hence, we need to explicitely handle it. > e.g. /usr/share/openvswitch/scripts/ovn-ctl

[ovs-dev] [PATCH] ovn-ctl: Handle whitespaces when using eval for start_ovsdb:

2018-04-20 Thread aginwala
eval doesn't understand white spaces which was introduced in commit 79c7961b8b3c4b7ea0251dea2ffacfa84c84fecb for starting clustered ovn dbs Hence, we need to explicitely handle it. e.g. /usr/share/openvswitch/scripts/ovn-ctl --db-nb-addr=192.168.220.101 --db-nb-create-insecure-remote=yes \