On Fri, Feb 28, 2020 at 3:21 PM Ben Pfaff <b...@ovn.org> wrote:
>
> On Tue, Feb 25, 2020 at 11:59:06AM -0800, William Tu wrote:
> > Currently ovs-bugtool does not work due to Python2 deprecated.
> > When moving to Python3, a couple of things are broken in ovs-bugtool,
> > ex: import libraries issues such as StringIO and commands.
> > Also there are some bytes to string convertion in this patch
> > because in Python3,strings are now always Unicode and a new type 'bytes'
> > is added for handling binary strings.
> >
> > Signed-off-by: William Tu <u9012...@gmail.com>
>
> Some of these are a little puzzling.  I see a lot more use of list()
> than I would have expected to be necessary.
>
> For example, I don't know why this change is needed:
> > -        for (k, v) in data.items():
> > +        for (k, v) in list(data.items()):
> >              cap = v['cap']
> >              if 'cmd_args' in v:
>
> and I think that this can be just "if 'output' not in v:"
> > -                if 'output' not in v.keys():
> > +                if 'output' not in list(v.keys()):
> >                      v['output'] = StringIOmtime()
> >                  if v['repeat_count'] > 0:
> >                      if cap not in process_lists:
>
Thanks Ben.
Actually for this patch, I first use a python conversion tool called "2to3".
https://docs.python.org/2/library/2to3.html

Then start to test and fix one by one.
I will look into these changes again.

William
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to