summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-06-19 18:43:18 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-06-19 18:43:18 -0700
commitb334a1035b645d9e727bdeb03e1fe3729bfc4e1a (patch)
treeb5c46f26aa0ee4d54de295811c37cd4aca29bdf3 /cloudinit
parent742a554a474475ac70f023e18a6ed29b2b88f906 (diff)
downloadvyos-cloud-init-b334a1035b645d9e727bdeb03e1fe3729bfc4e1a.tar.gz
vyos-cloud-init-b334a1035b645d9e727bdeb03e1fe3729bfc4e1a.zip
More path joinings found + update in logging of when we translate a path
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/helpers.py2
-rw-r--r--cloudinit/transforms/apt_update_upgrade.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/cloudinit/helpers.py b/cloudinit/helpers.py
index 9f55a984..09686340 100644
--- a/cloudinit/helpers.py
+++ b/cloudinit/helpers.py
@@ -253,7 +253,7 @@ class Paths(object):
# will confuse os.path.join
joined = joined.lstrip("/")
joined = os.path.join(root, joined)
- LOG.debug("Translated %s to adjusted path %s (%s)",
+ LOG.debug("Translated %s to adjusted path %s (read-only=%s)",
pre_joined, joined, read_only)
return joined
diff --git a/cloudinit/transforms/apt_update_upgrade.py b/cloudinit/transforms/apt_update_upgrade.py
index 29bbc1ae..f5b4b58f 100644
--- a/cloudinit/transforms/apt_update_upgrade.py
+++ b/cloudinit/transforms/apt_update_upgrade.py
@@ -124,6 +124,7 @@ def rename_apt_lists(omirror, new_mirror, lists_d="/var/lib/apt/lists"):
return
olen = len(oprefix)
for filename in glob.glob("%s_*" % oprefix):
+ # TODO use the cloud.paths.join...
util.rename(filename, "%s%s" % (nprefix, filename[olen:]))
@@ -136,7 +137,8 @@ def generate_sources_list(codename, mirror, cloud, log):
template_fn = cloud.get_template_filename('sources.list')
if template_fn:
params = {'mirror': mirror, 'codename': codename}
- templater.render_to_file(template_fn, '/etc/apt/sources.list', params)
+ out_fn = cloud.paths.join(False, '/etc/apt/sources.list')
+ templater.render_to_file(template_fn, out_fn, params)
else:
log.warn("No template found, not rendering /etc/apt/sources.list")