summaryrefslogtreecommitdiff
path: root/cloudinit/helpers.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/helpers.py')
-rw-r--r--cloudinit/helpers.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/cloudinit/helpers.py b/cloudinit/helpers.py
index e701126e..5e99d185 100644
--- a/cloudinit/helpers.py
+++ b/cloudinit/helpers.py
@@ -23,10 +23,11 @@
from time import time
import contextlib
-import io
import os
-from ConfigParser import (NoSectionError, NoOptionError, RawConfigParser)
+import six
+from six.moves.configparser import (
+ NoSectionError, NoOptionError, RawConfigParser)
from cloudinit.settings import (PER_INSTANCE, PER_ALWAYS, PER_ONCE,
CFG_ENV_NAME)
@@ -318,10 +319,7 @@ class ContentHandlers(object):
return self.registered[content_type]
def items(self):
- return self.registered.items()
-
- def iteritems(self):
- return self.registered.iteritems()
+ return list(self.registered.items())
class Paths(object):
@@ -449,7 +447,7 @@ class DefaultingConfigParser(RawConfigParser):
def stringify(self, header=None):
contents = ''
- with io.BytesIO() as outputstream:
+ with six.StringIO() as outputstream:
self.write(outputstream)
outputstream.flush()
contents = outputstream.getvalue()