On 4/28/22 15:43, Mike Pattrick wrote:
> Now ovs-tcpdump will check for an OVS_RUNDIR environment variable and
> if present, use it instead of the default RUNDIR. This is useful when
> used in conjunction with OVS_PAUSE_TEST while running the test suite.
> 
> Signed-off-by: Mike Pattrick <[email protected]>
> ---

Hi, Mike.  Thanks for the patch and sorry for a late review.

The fix seems correct to me in general.  See one small
comment below.

>  utilities/ovs-tcpdump.in | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/utilities/ovs-tcpdump.in b/utilities/ovs-tcpdump.in
> index 82d1bedfa..4798bdea6 100755
> --- a/utilities/ovs-tcpdump.in
> +++ b/utilities/ovs-tcpdump.in
> @@ -403,7 +403,10 @@ def py_which(executable):
>  
>  
>  def main():
> -    db_sock = 'unix:@RUNDIR@/db.sock'
> +    if 'OVS_RUNDIR' in os.environ:
> +        db_sock = 'unix:%s' % os.path.join(os.environ['OVS_RUNDIR'], 
> 'db.sock')
> +    else:
> +        db_sock = 'unix:@RUNDIR@/db.sock'

I'm not a python expert, but it might be better to just call
os.environ.get('OVS_RUNDIR', '@RUNDIR@') and then construct
the db_sock path using the result.

What do you think?

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to