~ubuntu-branches/ubuntu/raring/cloud-init/raring

« back to all changes in this revision

Viewing changes to cloudinit/user_data.py

  • Committer: Package Import Robot
  • Author(s): Scott Moser
  • Date: 2013-03-27 10:04:41 UTC
  • mfrom: (245.1.4 raring)
  • Revision ID: package-import@ubuntu.com-20130327100441-o1u6gxh6f5pat822
Tags: 0.7.2~bzr804-0ubuntu1
* New upstream snapshot.
  * use python-requests rather than urllib2 for http (LP: #1067888)
  * handle failure of resizefs better.  Specifically, do not show
    warnings or stack trace in lxc (LP: #1160462)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
from cloudinit import handlers
31
31
from cloudinit import log as logging
32
 
from cloudinit import url_helper
33
32
from cloudinit import util
34
33
 
35
34
LOG = logging.getLogger(__name__)
60
59
class UserDataProcessor(object):
61
60
    def __init__(self, paths):
62
61
        self.paths = paths
 
62
        self.ssl_details = util.fetch_ssl_details(paths)
63
63
 
64
64
    def process(self, blob):
65
65
        accumulating_msg = MIMEMultipart()
173
173
            if include_once_on and os.path.isfile(include_once_fn):
174
174
                content = util.load_file(include_once_fn)
175
175
            else:
176
 
                resp = url_helper.readurl(include_url)
 
176
                resp = util.read_file_or_url(include_url,
 
177
                                             ssl_details=self.ssl_details)
177
178
                if include_once_on and resp.ok():
178
179
                    util.write_file(include_once_fn, str(resp), mode=0600)
179
180
                if resp.ok():