Skip to content

Commit

Permalink
Fix chef module run failure when chef_license is set (#868)
Browse files Browse the repository at this point in the history
Move chef_license from TPL_PATH_KEYS to TPL_KEYS as the chef license
setting is not a path but must be added to the client config template.
Fixes file or folder not found exception raised from ensure_dirs.
  • Loading branch information
bmhughes committed Apr 26, 2021
1 parent b231166 commit 02db2c3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cloudinit/config/cc_chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
'json_attribs',
'pid_file',
'encrypted_data_bag_secret',
'chef_license',
])
CHEF_RB_TPL_KEYS = list(CHEF_RB_TPL_DEFAULTS.keys())
CHEF_RB_TPL_KEYS.extend(CHEF_RB_TPL_BOOL_KEYS)
Expand All @@ -80,6 +79,7 @@
'node_name',
'environment',
'validation_name',
'chef_license',
])
CHEF_RB_TPL_KEYS = frozenset(CHEF_RB_TPL_KEYS)
CHEF_RB_PATH = '/etc/chef/client.rb'
Expand Down
2 changes: 1 addition & 1 deletion templates/chef_client.rb.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The reason these are not in quotes is because they are ruby
symbols that will be placed inside here, and not actual strings...
#}
{% if chef_license %}
chef_license "{{chef_license}}"
chef_license "{{chef_license}}"
{% endif%}
{% if log_level %}
log_level {{log_level}}
Expand Down
1 change: 1 addition & 0 deletions tools/.github-cla-signers
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ WebSpider
xiachen-rh
xnox
hamalq
bmhughes

0 comments on commit 02db2c3

Please sign in to comment.