summaryrefslogtreecommitdiff
path: root/cloudinit/user_data.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/user_data.py')
-rw-r--r--cloudinit/user_data.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/cloudinit/user_data.py b/cloudinit/user_data.py
index 15af1daf..6f41b03a 100644
--- a/cloudinit/user_data.py
+++ b/cloudinit/user_data.py
@@ -9,14 +9,11 @@
# This file is part of cloud-init. See LICENSE file for license information.
import os
-
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.mime.nonmultipart import MIMENonMultipart
from email.mime.text import MIMEText
-import six
-
from cloudinit import handlers
from cloudinit import log as logging
from cloudinit.url_helper import read_file_or_url, UrlError
@@ -259,7 +256,7 @@ class UserDataProcessor(object):
# filename and type not be present
# or
# scalar(payload)
- if isinstance(ent, six.string_types):
+ if isinstance(ent, str):
ent = {'content': ent}
if not isinstance(ent, (dict)):
# TODO(harlowja) raise?
@@ -269,13 +266,13 @@ class UserDataProcessor(object):
mtype = ent.get('type')
if not mtype:
default = ARCHIVE_UNDEF_TYPE
- if isinstance(content, six.binary_type):
+ if isinstance(content, bytes):
default = ARCHIVE_UNDEF_BINARY_TYPE
mtype = handlers.type_from_starts_with(content, default)
maintype, subtype = mtype.split('/', 1)
if maintype == "text":
- if isinstance(content, six.binary_type):
+ if isinstance(content, bytes):
content = content.decode()
msg = MIMEText(content, _subtype=subtype)
else:
@@ -348,7 +345,7 @@ def convert_string(raw_data, content_type=NOT_MULTIPART_TYPE):
msg.set_payload(data)
return msg
- if isinstance(raw_data, six.text_type):
+ if isinstance(raw_data, str):
bdata = raw_data.encode('utf-8')
else:
bdata = raw_data