Merge pull request #23 from bdrung/master
Support Python 3
diff --git a/_states/glanceng.py b/_states/glanceng.py
index e245866..bcf4d60 100644
--- a/_states/glanceng.py
+++ b/_states/glanceng.py
@@ -56,7 +56,7 @@
if type(images) is dict and len(images) == 1 and 'images' in images:
images = images['images']
- images_list = images.values() if type(images) is dict else images
+ images_list = list(images.values()) if type(images) is dict else images
if len(images_list) == 0:
return None, 'No image with name "{0}"'.format(name)
diff --git a/glance/client.sls b/glance/client.sls
index 3f45edb..1733e37 100644
--- a/glance/client.sls
+++ b/glance/client.sls
@@ -5,9 +5,9 @@
pkg.installed:
- names: {{ client.pkgs }}
-{%- for identity_name, identity in client.identity.iteritems() %}
+{%- for identity_name, identity in client.identity.items() %}
-{%- for image_name, image in identity.image.iteritems() %}
+{%- for image_name, image in identity.image.items() %}
glance_openstack_image_{{ image_name }}:
glanceng.image_import:
diff --git a/glance/files/_backends/_swift.conf b/glance/files/_backends/_swift.conf
index 2b34391..238b4d4 100644
--- a/glance/files/_backends/_swift.conf
+++ b/glance/files/_backends/_swift.conf
@@ -1,6 +1,6 @@
{%- from "glance/map.jinja" import server with context %}
-{% for reference_key, reference in server.storage.get('swift', {}).get('store', {}).get('references', {}).iteritems() %}
+{% for reference_key, reference in server.storage.get('swift', {}).get('store', {}).get('references', {}).items() %}
[{{ reference_key }}]
# A project_name user_name pair in the project_name:user_name format to authenticate against the Swift authentication service.
user = {{ reference.user }}
diff --git a/glance/server.sls b/glance/server.sls
index b160b7c..4adbb83 100644
--- a/glance/server.sls
+++ b/glance/server.sls
@@ -285,7 +285,7 @@
{%- endfor %}
-{%- for image_name, image in server.get('image', {}).iteritems() %}
+{%- for image_name, image in server.get('image', {}).items() %}
glance_download_{{ image_name }}:
cmd.run:
@@ -321,7 +321,7 @@
- service: glance_services
{%- endif %}
-{%- for name, rule in server.get('policy', {}).iteritems() %}
+{%- for name, rule in server.get('policy', {}).items() %}
{%- if rule != None %}
rule_{{ name }}_present: