Use six.iteritems instead of iteritems() in profitbricks driver

This commit is contained in:
rallytime 2016-07-17 14:03:09 -06:00
parent 96055b4fc6
commit 754d79db0b

View File

@ -78,6 +78,7 @@ import time
# Import salt libs # Import salt libs
import salt.utils import salt.utils
import salt.config as config import salt.config as config
import salt.ext.six as six
from salt.exceptions import ( from salt.exceptions import (
SaltCloudConfigError, SaltCloudConfigError,
SaltCloudNotFound, SaltCloudNotFound,
@ -317,7 +318,7 @@ def get_image(vm_):
) )
images = avail_images() images = avail_images()
for key, value in images.iteritems(): for key, value in six.iteritems(images):
if vm_image and vm_image in (images[key]['id'], images[key]['name']): if vm_image and vm_image in (images[key]['id'], images[key]['name']):
return images[key] return images[key]
@ -494,7 +495,7 @@ def create_network_interfaces(conn, datacenter_id, server_id, vm_):
if 'private_lan' in vm_: if 'private_lan' in vm_:
lans['private_lan'] = vm_['private_lan'] lans['private_lan'] = vm_['private_lan']
for lan, lan_id in lans.iteritems(): for lan, lan_id in six.iteritems(lans):
response = None response = None
nic = NIC(lan=lan_id, name=lan.split('_')[0]) nic = NIC(lan=lan_id, name=lan.split('_')[0])
try: try: