diff options
author | Scott Moser <smoser@ubuntu.com> | 2011-07-26 11:18:10 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2011-07-26 11:18:10 -0400 |
commit | 155e519a63703183823ef9368e2fdb3a6b7b0c0a (patch) | |
tree | 74b6ffb551cfdbc9d39ea63263e1d063ef0a931e | |
parent | a6dce5ac548de073918d679503f447d265847066 (diff) | |
download | vyos-cloud-init-155e519a63703183823ef9368e2fdb3a6b7b0c0a.tar.gz vyos-cloud-init-155e519a63703183823ef9368e2fdb3a6b7b0c0a.zip |
use util.write_file in cc_mcollective.py
-rw-r--r-- | cloudinit/CloudConfig/cc_mcollective.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cloudinit/CloudConfig/cc_mcollective.py b/cloudinit/CloudConfig/cc_mcollective.py index b894a7bb..c7912aa4 100644 --- a/cloudinit/CloudConfig/cc_mcollective.py +++ b/cloudinit/CloudConfig/cc_mcollective.py @@ -75,14 +75,14 @@ def handle(name,cfg,cloud,log,args): outputfile = StringIO.StringIO() mcollective_config.write(outputfile) # Now we got the whole file, write to disk except first line - final_configfile = open('/etc/mcollective/server.cfg', 'wb') # Note below, that we've just used ConfigParser because it generally # works. Below, we remove the initial 'nullsection' header # and then change 'key = value' to 'key: value'. The global # search and replace of '=' with ':' could be problematic though. # this most likely needs fixing. - final_configfile.write(outputfile.getvalue().replace('[nullsection]\n','').replace(' =',':')) - final_configfile.close() + util.write_file('/etc/mcollective/server.cfg', + outputfile.getvalue().replace('[nullsection]\n','').replace(' =',':'), + mode=0644) # Start mcollective subprocess.check_call(['service', 'mcollective', 'start']) |