summaryrefslogtreecommitdiff
path: root/cloudinit/config
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@gmail.com>2014-10-11 16:59:50 -0700
committerJoshua Harlow <harlowja@gmail.com>2014-10-11 16:59:50 -0700
commitd87e89d9c674bac7e87d483037850a9ee4fc984a (patch)
treead30f34179a8d8aa64552357a1808cffe863d736 /cloudinit/config
parent9452f1247f69c2a8e8dedaac804f3c95bff0821b (diff)
downloadvyos-cloud-init-d87e89d9c674bac7e87d483037850a9ee4fc984a.tar.gz
vyos-cloud-init-d87e89d9c674bac7e87d483037850a9ee4fc984a.zip
More adjustments
- Use the generated_by() utility function to give the ruby template a better header comment - Set special parameters after selecting the basic chef parameters.
Diffstat (limited to 'cloudinit/config')
-rw-r--r--cloudinit/config/cc_chef.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/cloudinit/config/cc_chef.py b/cloudinit/config/cc_chef.py
index fb825404..999b658d 100644
--- a/cloudinit/config/cc_chef.py
+++ b/cloudinit/config/cc_chef.py
@@ -79,13 +79,6 @@ def is_installed():
def get_template_params(iid, chef_cfg, log):
params = CHEF_RB_TPL_DEFAULTS.copy()
- params.update({
- 'server_url': chef_cfg['server_url'],
- 'node_name': util.get_cfg_option_str(chef_cfg, 'node_name', iid),
- 'environment': util.get_cfg_option_str(chef_cfg, 'environment',
- '_default'),
- 'validation_name': chef_cfg['validation_name'],
- })
# Allow users to overwrite any of the keys they want (if they so choose),
# when a value is None, then the value will be set to None and no boolean
# or string version will be populated...
@@ -101,7 +94,17 @@ def get_template_params(iid, chef_cfg, log):
params[k] = util.get_cfg_option_bool(chef_cfg, k)
else:
params[k] = util.get_cfg_option_str(chef_cfg, k)
- params['generated_on'] = datetime.now().isoformat()
+ # These ones are overwritten to be exact values...
+ params.update({
+ 'generated_by': util.make_header(),
+ 'server_url': util.get_cfg_option_str(chef_cfg, 'server_url'),
+ 'node_name': util.get_cfg_option_str(chef_cfg, 'node_name',
+ default=iid),
+ 'environment': util.get_cfg_option_str(chef_cfg, 'environment',
+ default='_default'),
+ 'validation_name': util.get_cfg_option_str(chef_cfg,
+ 'validation_name'),
+ })
return params