From 43eb6d5aace53bef2116dde0796807befef1d8ff Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Tue, 19 Jun 2012 17:58:41 -0700 Subject: Make most of all the places use the paths join() function so that testing with non-real read/write paths is easier. --- cloudinit/transforms/mounts.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cloudinit/transforms/mounts.py') diff --git a/cloudinit/transforms/mounts.py b/cloudinit/transforms/mounts.py index 44182b87..700fbc44 100644 --- a/cloudinit/transforms/mounts.py +++ b/cloudinit/transforms/mounts.py @@ -168,7 +168,7 @@ def handle(_name, cfg, cloud, log, _args): cc_lines.append('\t'.join(line)) fstab_lines = [] - fstab = util.load_file("/etc/fstab") + fstab = util.load_file(cloud.paths.join(True, "/etc/fstab")) for line in fstab.splitlines(): try: toks = ws.split(line) @@ -180,7 +180,7 @@ def handle(_name, cfg, cloud, log, _args): fstab_lines.extend(cc_lines) contents = "%s\n" % ('\n'.join(fstab_lines)) - util.write_file("/etc/fstab", contents) + util.write_file(cloud.paths.join(False, "/etc/fstab"), contents) if needswap: try: @@ -190,7 +190,7 @@ def handle(_name, cfg, cloud, log, _args): for d in dirs: try: - util.ensure_dir(d) + util.ensure_dir(cloud.paths.join(False, d)) except: util.logexc(log, "Failed to make '%s' config-mount", d) -- cgit v1.2.3