chef-ingredient
chef-ingredient copied to clipboard
'channel' attributes are Symbols, Policyfiles won't allow Symbols
This is a bug for chef-ingredient currently, but it may be considered a Policyfile bug.
If you try to set :stable
in your Policyfile you get
Reason: (ChefDK::InvalidPolicyfileAttribute) Invalid type in attributes. Only Hash, Array, String, Integer, Float, true, false, and nil are accepted. You gave :stable (Symbol)
Strings will work.
@mattray I understand why this is confusing since the channel attribute restricts types to Symbols. This isn't as much a bug in Policyfiles or chef-ingredient as it is more idiosyncratic. The issue here is that the cookbook shouldn't use Symbols and should use Strings for this exact reason - it can be confusing - although it works functionally. I do agree the cookbook should be updated to eliminate this Ruby-ism. Noted!