diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-16 08:58:08 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-16 08:58:08 -0700 |
commit | 5fefdecc1191cd96634063e7616f89b21f066203 (patch) | |
tree | 3c9675008c28751eb25583dc5c87aa6e45eed517 | |
parent | 22ea7bb511232954949a6ffecce9d248117517f3 (diff) | |
download | vyos-cloud-init-5fefdecc1191cd96634063e7616f89b21f066203.tar.gz vyos-cloud-init-5fefdecc1191cd96634063e7616f89b21f066203.zip |
1. Add comment as to what http proxy setting means
2. Adjust so file contents will join with a string instead of appending to something that might not be a string
-rw-r--r-- | cloudinit/transforms/cc_apt_update_upgrade.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cloudinit/transforms/cc_apt_update_upgrade.py b/cloudinit/transforms/cc_apt_update_upgrade.py index a4e058c6..d49d8bd2 100644 --- a/cloudinit/transforms/cc_apt_update_upgrade.py +++ b/cloudinit/transforms/cc_apt_update_upgrade.py @@ -49,6 +49,7 @@ def handle(_name, cfg, cloud, log, _args): proxy_filename = "/etc/apt/apt.conf.d/95cloud-init-proxy" if proxy: try: + # See http://linux.die.net/man/5/apt.conf contents = "Acquire::HTTP::Proxy \"%s\";\n" util.write_file(proxy_filename, contents % (proxy)) except Exception as e: @@ -186,7 +187,7 @@ def add_sources(srclist, template_params=None): errorlist.append([source, "failed add key"]) try: - util.write_file(ent['filename'], source + "\n", omode="ab") + util.write_file(ent['filename'], "%s\n" % (source), omode="ab") except: errorlist.append([source, "failed write to file %s" % ent['filename']]) |