summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorharlowja <harlowja@virtualbox.rhel>2012-06-21 08:56:36 -0700
committerharlowja <harlowja@virtualbox.rhel>2012-06-21 08:56:36 -0700
commit64f1347cb8f2580339d539b7772e7872ed81cae9 (patch)
tree7414c664502a669a68d08466712ed8e064878e2d /cloudinit
parentf1cab0d88cbcfa7eaa698db7dcc252bb6543d6c0 (diff)
downloadvyos-cloud-init-64f1347cb8f2580339d539b7772e7872ed81cae9.tar.gz
vyos-cloud-init-64f1347cb8f2580339d539b7772e7872ed81cae9.zip
Move to a write location and when writing, also write to the write location, instead of the read-only one
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/config/cc_mcollective.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/config/cc_mcollective.py b/cloudinit/config/cc_mcollective.py
index ba5e13ca..3fec6729 100644
--- a/cloudinit/config/cc_mcollective.py
+++ b/cloudinit/config/cc_mcollective.py
@@ -83,7 +83,7 @@ def handle(name, cfg, cloud, log, _args):
mcollective_config.set(cfg_name, o, v)
# We got all our config as wanted we'll rename
# the previous server.cfg and create our new one
- old_fn = "%s.old" % (server_cfg_fn)
+ old_fn = cloud.paths.join(False, '/etc/mcollective/server.cfg.old')
util.rename(server_cfg_fn, old_fn)
# Now we got the whole file, write to disk except the section
# we added so that config parser won't error out when trying to read.
@@ -91,7 +91,8 @@ def handle(name, cfg, cloud, log, _args):
# works. Below, we remove the initial 'nullsection' header.
contents = mcollective_config.stringify()
contents = contents.replace("%s\n" % (section_head), "")
- util.write_file(server_cfg_fn, contents, mode=0644)
+ server_cfg_rw = cloud.paths.join(False, '/etc/mcollective/server.cfg')
+ util.write_file(server_cfg_rw, contents, mode=0644)
# Start mcollective
util.subp(['service', 'mcollective', 'start'], capture=False)