summaryrefslogtreecommitdiff
path: root/cloudinit/CloudConfig
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2011-07-21 05:10:47 -0400
committerScott Moser <smoser@ubuntu.com>2011-07-21 05:10:47 -0400
commit53f197772be11b32373e81ecdc256df8d35a8922 (patch)
tree212f93136f0abf69b05259adee9cc8ac490a2132 /cloudinit/CloudConfig
parentae7b3a451783bb298d3ecb75f34e6fbc5b0162e9 (diff)
downloadvyos-cloud-init-53f197772be11b32373e81ecdc256df8d35a8922.tar.gz
vyos-cloud-init-53f197772be11b32373e81ecdc256df8d35a8922.zip
fix syntax error in cc_chef.py
Diffstat (limited to 'cloudinit/CloudConfig')
-rw-r--r--cloudinit/CloudConfig/cc_chef.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/cloudinit/CloudConfig/cc_chef.py b/cloudinit/CloudConfig/cc_chef.py
index 63e3808a..25155c55 100644
--- a/cloudinit/CloudConfig/cc_chef.py
+++ b/cloudinit/CloudConfig/cc_chef.py
@@ -48,10 +48,12 @@ def handle(name,cfg,cloud,log,args):
if chef_cfg.has_key('validation_cert'):
with open('/etc/chef/validation.cert', 'w') as validation_cert_fh:
validation_cert_fh.write(chef_cfg['validation_cert'])
-
+
+ validation_name = chef_cfg.get('validation_name','chef-validator')
# create the chef config from template
util.render_to_file('chef_client.rb', '/etc/chef/client.rb',
- {'server_url': chef_cfg['server_url'], 'validation_name': chef_cfg['validation_name'] || 'chef-validator'})
+ {'server_url': chef_cfg['server_url'],
+ 'validation_name': chef_cfg['validation_name']})
chef_args = ['-d']
# set the firstboot json
@@ -64,6 +66,7 @@ def handle(name,cfg,cloud,log,args):
chef_args.append('-j /etc/chef/firstboot.json')
# and finally, run chef
+ log.debug("running chef-client %s" % chef_args)
subprocess.check_call(['/usr/bin/chef-client'] + chef_args)
def install_chef_from_gems(ruby_version, chef_version = None):