summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cloudinit/CloudConfig/cc_chef.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/cloudinit/CloudConfig/cc_chef.py b/cloudinit/CloudConfig/cc_chef.py
index cbf92ee7..5f13c77d 100644
--- a/cloudinit/CloudConfig/cc_chef.py
+++ b/cloudinit/CloudConfig/cc_chef.py
@@ -61,10 +61,10 @@ def handle(name,cfg,cloud,log,args):
if chef_cfg.has_key('run_list'):
with open('/etc/chef/firstboot.json', 'w') as firstboot_json_fh:
firstboot_json_fh.write("{\n\"run_list\":\n[\n")
- for runlist_item in chef_cfg['run_list']:
- firstboot_json_fh.write("\"" + runlist_item + "\"\n")
- firstboot_json_fh.write("]\n}")
-
+ firstboot_json_fh.write(
+ ",\n".join(["\"%s\"" % runlist_item for runlist_item in chef_cfg['run_list']])
+ )
+ firstboot_json_fh.write("]\n\}")
chef_args.append('-j /etc/chef/firstboot.json')
# and finally, run chef