openstack: iterate through nova addresses with six (#18408)

This commit is contained in:
Ben Cordero 2016-11-18 20:44:16 +00:00 committed by Toshio Kuratomi
parent 4dba83afc5
commit a9a2f12adb

View file

@ -28,6 +28,7 @@
import os import os
from ansible.module_utils.six import iteritems
def openstack_argument_spec(): def openstack_argument_spec():
# DEPRECATED: This argument spec is only used for the deprecated old # DEPRECATED: This argument spec is only used for the deprecated old
@ -61,7 +62,7 @@ def openstack_argument_spec():
def openstack_find_nova_addresses(addresses, ext_tag, key_name=None): def openstack_find_nova_addresses(addresses, ext_tag, key_name=None):
ret = [] ret = []
for (k, v) in addresses.iteritems(): for (k, v) in iteritems(addresses):
if key_name and k == key_name: if key_name and k == key_name:
ret.extend([addrs['addr'] for addrs in v]) ret.extend([addrs['addr'] for addrs in v])
else: else: