summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-06-16 07:37:35 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-06-16 07:37:35 -0700
commit4a328b5629db121accd81de9ced4c4d69b038f9a (patch)
tree80c476261c51399ecb648af912982480c46a0e4f /cloudinit
parent8d3c67458842d0c03d28f79cb02d19e32136f7ef (diff)
downloadvyos-cloud-init-4a328b5629db121accd81de9ced4c4d69b038f9a.tar.gz
vyos-cloud-init-4a328b5629db121accd81de9ced4c4d69b038f9a.zip
Some simple fixes that will make the python 3 translation easier
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/user_data.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/cloudinit/user_data.py b/cloudinit/user_data.py
index 9915b8b0..866bf6de 100644
--- a/cloudinit/user_data.py
+++ b/cloudinit/user_data.py
@@ -68,7 +68,8 @@ INCLUSION_TYPES_MAP = {
}
# Sorted longest first
-INCLUSION_SRCH = sorted(INCLUSION_TYPES_MAP.keys(), key=(lambda e: 0 - len(e)))
+INCLUSION_SRCH = sorted(list(INCLUSION_TYPES_MAP.keys()),
+ key=(lambda e: 0 - len(e)))
# Various special content types
TYPE_NEEDED = ["text/plain", "text/x-not-multipart"]
@@ -193,7 +194,7 @@ class UserDataProcessor(object):
msg.add_header('Content-Disposition', 'attachment',
filename=ent['filename'])
- for header in ent.keys():
+ for header in list(ent.keys()):
if header in ('content', 'filename', 'type'):
continue
msg.add_header(header, ent['header'])
@@ -363,7 +364,7 @@ def convert_string(raw_data, headers=None):
data = util.decomp_str(raw_data)
if "mime-version:" in data[0:4096].lower():
msg = email.message_from_string(data)
- for (key, val) in headers.items():
+ for (key, val) in headers.iteritems():
if key in msg:
msg.replace_header(key, val)
else: