summaryrefslogtreecommitdiff
path: root/cloudinit/user_data.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-06-15 21:33:55 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-06-15 21:33:55 -0700
commit450261a1fcf1f8929a2f7a25c2c278ba40689289 (patch)
tree83430d74ea63c5a11df3fb774e281d0f8efce8f3 /cloudinit/user_data.py
parent784edb7689d60b81a4334d5171603841cc83da98 (diff)
downloadvyos-cloud-init-450261a1fcf1f8929a2f7a25c2c278ba40689289.tar.gz
vyos-cloud-init-450261a1fcf1f8929a2f7a25c2c278ba40689289.zip
Fixups to ensure that pylint does not find anything major wrong.
Diffstat (limited to 'cloudinit/user_data.py')
-rw-r--r--cloudinit/user_data.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/cloudinit/user_data.py b/cloudinit/user_data.py
index 64fc2734..9915b8b0 100644
--- a/cloudinit/user_data.py
+++ b/cloudinit/user_data.py
@@ -22,14 +22,15 @@
import os
-import glob
import email
-
+from email.mime.multipart import MIMEMultipart
+from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from cloudinit import importer
from cloudinit import log as logging
+from cloudinit import url_helper
from cloudinit import util
from cloudinit.settings import (PER_ALWAYS, PER_INSTANCE, FREQUENCIES)
@@ -86,7 +87,7 @@ class UserDataProcessor(object):
self.paths = paths
def process(self, blob):
- base_msg = ud.convert_string(blob)
+ base_msg = convert_string(blob)
process_msg = MIMEMultipart()
self._process_msg(base_msg, process_msg)
return process_msg
@@ -105,7 +106,7 @@ class UserDataProcessor(object):
ctype_orig = UNDEF_TYPE
if ctype_orig in TYPE_NEEDED:
- ctype = ud.type_from_starts_with(payload)
+ ctype = type_from_starts_with(payload)
if ctype is None:
ctype = ctype_orig
@@ -158,7 +159,7 @@ class UserDataProcessor(object):
if not url_helper.ok_http_code(st):
content = ''
- new_msg = ud.convert_string(content)
+ new_msg = convert_string(content)
self._process_msg(new_msg, append_msg)
def _explode_archive(self, archive, append_msg):
@@ -179,7 +180,7 @@ class UserDataProcessor(object):
content = ent.get('content', '')
mtype = ent.get('type')
if not mtype:
- mtype = ud.type_from_starts_with(content, ARCHIVE_UNDEF_TYPE)
+ mtype = type_from_starts_with(content, ARCHIVE_UNDEF_TYPE)
maintype, subtype = mtype.split('/', 1)
if maintype == "text":