Commit 2b3f5629 authored by Scott Moser's avatar Scott Moser

provide a warning if 'system' but file does not exist

parent 7122f7d6
......@@ -209,8 +209,13 @@ def handle(name, cfg, cloud, log, _args):
vcert = chef_cfg.get('validation_cert')
# special value 'system' means do not overwrite the file
# but still render the template to contain 'validation_key'
if vcert and vcert != "system":
util.write_file(vkey_path, vcert)
if vcert:
if vcert != "system":
util.write_file(vkey_path, vcert)
elif not os.path.isfile(vkey_path):
log.warn("chef validation_cert provided as 'system', but "
"validation_key path '%s' does not exist.",
# Create the chef config from template
template_fn = cloud.get_template_filename('chef_client.rb')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment