Comment 4 for bug 1835456

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (master)

Reviewed: https://review.opendev.org/669219
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=d60eb1b4be4fdf0c990601337473ce683658f40f
Submitter: Zuul
Branch: master

commit d60eb1b4be4fdf0c990601337473ce683658f40f
Author: Emilien Macchi <email address hidden>
Date: Thu Jul 4 15:22:09 2019 -0400

    Python 3 fixes for tripleo-hieradata role

    1) all_nodes.j2: use DICT.items() instead of dict.iteritems
    The DICT.iteritems method has been removed in Python 3.

    There are two recommended alternatives:

      for KEY, VALUE in DICT.items():
          pass

      or

      from ansible.module_utils.six import iteritems

      for KEY, VALUE in iteritems(DICT):
          pass

    This patch replace iteritems by items.

    2) vip_data.j2: use "in" instead of "has_key()"

    dict.has_key() was removed in Python 3 and we should use "in" operator
    instead.

      https://docs.python.org/3.1/whatsnew/3.0.html#builtins

    This patch changes the vip data to use "in".

    Closes-Bug: #1835456
    Change-Id: If9515b8b09cf17028cc4c43278560e8d8b866eed