diff options
author | Scott Moser <smoser@ubuntu.com> | 2013-03-20 08:35:24 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2013-03-20 08:35:24 -0400 |
commit | 41190448decad51cf76a85d727e6935a8a206cca (patch) | |
tree | f4548e8595cafff2ffc13d914dbadef7b8c737db /cloudinit/user_data.py | |
parent | f8318f8eec9c8f1c1676ce6a5b5c2c77fa2f7cc5 (diff) | |
parent | ab71760d7e127ae9a3cf31a4f6d7600c945f0dd7 (diff) | |
download | vyos-cloud-init-41190448decad51cf76a85d727e6935a8a206cca.tar.gz vyos-cloud-init-41190448decad51cf76a85d727e6935a8a206cca.zip |
use 'requests' rather than urllib2.
This re-works the urlhelper and users of it to use requests rather
than urllib2. The primary benefit is that now when using recent
versions of python-requests (>= 0.8.8) https certificates will be checked.
Diffstat (limited to 'cloudinit/user_data.py')
-rw-r--r-- | cloudinit/user_data.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/user_data.py b/cloudinit/user_data.py index 58827e3d..df069ff8 100644 --- a/cloudinit/user_data.py +++ b/cloudinit/user_data.py @@ -29,7 +29,6 @@ from email.mime.text import MIMEText from cloudinit import handlers from cloudinit import log as logging -from cloudinit import url_helper from cloudinit import util LOG = logging.getLogger(__name__) @@ -60,6 +59,7 @@ EXAMINE_FOR_LAUNCH_INDEX = ["text/cloud-config"] class UserDataProcessor(object): def __init__(self, paths): self.paths = paths + self.ssl_details = util.fetch_ssl_details(paths) def process(self, blob): accumulating_msg = MIMEMultipart() @@ -173,7 +173,8 @@ class UserDataProcessor(object): if include_once_on and os.path.isfile(include_once_fn): content = util.load_file(include_once_fn) else: - resp = url_helper.readurl(include_url) + resp = util.read_file_or_url(include_url, + ssl_details=self.ssl_details) if include_once_on and resp.ok(): util.write_file(include_once_fn, str(resp), mode=0600) if resp.ok(): |