Remove itervalues (not available on py3)
(cherry picked from 51491c9904
)
This commit is contained in:
parent
abc0eeac02
commit
3beac89893
1 changed files with 2 additions and 2 deletions
|
@ -26,7 +26,7 @@ import re
|
||||||
import os
|
import os
|
||||||
import ConfigParser
|
import ConfigParser
|
||||||
from novaclient import client as nova_client
|
from novaclient import client as nova_client
|
||||||
from six import iteritems
|
from six import iteritems, itervalues
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import json
|
import json
|
||||||
|
@ -105,7 +105,7 @@ def get_ips(server, access_ip=True):
|
||||||
# Iterate through each servers network(s), get addresses and get type
|
# Iterate through each servers network(s), get addresses and get type
|
||||||
addresses = getattr(server, 'addresses', {})
|
addresses = getattr(server, 'addresses', {})
|
||||||
if len(addresses) > 0:
|
if len(addresses) > 0:
|
||||||
for network in addresses.itervalues():
|
for network in itervalues(addresses):
|
||||||
for address in network:
|
for address in network:
|
||||||
if address.get('OS-EXT-IPS:type', False) == 'fixed':
|
if address.get('OS-EXT-IPS:type', False) == 'fixed':
|
||||||
private.append(address['addr'])
|
private.append(address['addr'])
|
||||||
|
|
Loading…
Reference in a new issue