[ovs-git] [openvswitch/ovs] d7a176: ovsdb: Use items() instead of iteritems() for Pyth...

GitHub noreply at github.com
Fri Feb 23 22:08:57 UTC 2018


  Branch: refs/heads/branch-2.8
  Home:   https://github.com/openvswitch/ovs
  Commit: d7a1767c61155309b332e9a0512f145fecf52b9a
      https://github.com/openvswitch/ovs/commit/d7a1767c61155309b332e9a0512f145fecf52b9a
  Author: Markos Chandras <mchandras at suse.de>
  Date:   2018-02-23 (Fri, 23 Feb 2018)

  Changed paths:
    M ovsdb/ovsdb-dot.in
    M ovsdb/ovsdb-idlc.in

  Log Message:
  -----------
  ovsdb: Use items() instead of iteritems() for Python3

Python3 removed the iteritems() iterator and replaced it with items()
which should also work in Python2. This fixes the following build
problem on Python3:

Traceback (most recent call last):
  File "./ovsdb/ovsdb-idlc.in", line 1436, in <module>
    func(*args[1:])
  File "./ovsdb/ovsdb-idlc.in", line 314, in printCIDLHeader
    for columnName, column in sorted(table.columns.iteritems()):
AttributeError: 'dict' object has no attribute 'iteritems'

Signed-off-by: Markos Chandras <mchandras at suse.de>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: 54948553b8060b720951d5bc0a6ba24cda2c9ebd
      https://github.com/openvswitch/ovs/commit/54948553b8060b720951d5bc0a6ba24cda2c9ebd
  Author: Markos Chandras <mchandras at suse.de>
  Date:   2018-02-23 (Fri, 23 Feb 2018)

  Changed paths:
    M ovsdb/ovsdb-dot.in

  Log Message:
  -----------
  ovsdb: ovsdb-dot.in: Use print function for Python3

The python2 print statement no longer works in python3 since the
latter uses a print function. As such, replace all instances of
'print' with 'print()'. This fixes the following build problem with
python3

> ovsdb/ovsdb-client.1.tmp
File "./ovsdb/ovsdb-dot.in", line 34
    print "\t%s -> %s [%s];" % (
                     ^
SyntaxError: invalid syntax

Signed-off-by: Markos Chandras <mchandras at suse.de>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: 825cbf73f444d625d59bf07329a23f6d3d1957d4
      https://github.com/openvswitch/ovs/commit/825cbf73f444d625d59bf07329a23f6d3d1957d4
  Author: Markos Chandras <mchandras at suse.de>
  Date:   2018-02-23 (Fri, 23 Feb 2018)

  Changed paths:
    M ovsdb/ovsdb-dot.in

  Log Message:
  -----------
  ovsdb: ovsdb-dot.in: Change exception semantics for Python3

PEP-3110 changes the semantics for capturing exceptions in Python3
from 'except E,N' to 'except E as N'. This fixes the following problem
when building with python3

SyntaxError: invalid syntax
  File "./ovsdb/ovsdb-dot.in", line 106
    except ovs.db.error.Error, e:
                       ^
SyntaxError: invalid syntax

Link: https://www.python.org/dev/peps/pep-3110/
Signed-off-by: Markos Chandras <mchandras at suse.de>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: 28f53188135fd61c0c8067d56105d469e97a16a7
      https://github.com/openvswitch/ovs/commit/28f53188135fd61c0c8067d56105d469e97a16a7
  Author: Markos Chandras <mchandras at suse.de>
  Date:   2018-02-23 (Fri, 23 Feb 2018)

  Changed paths:
    M ovsdb/ovsdb-dot.in

  Log Message:
  -----------
  ovsdb: ovsdb-dot.in: Replace sys.maxint with sys.maxsize for Python3

There is no sys.maxint anymore on python3. However, sys.maxsize can be
used as an integer larger than any practical list or string index.

Link: https://docs.python.org/3.1/whatsnew/3.0.html#integers
Signed-off-by: Markos Chandras <mchandras at suse.de>
Signed-off-by: Ben Pfaff <blp at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/470d76acd61b...28f53188135f


More information about the git mailing list