-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for node['audit']['profiles'] as a hash of hashes #328
Conversation
@mattray Great work. Should we update the docs to make the hash map the default now? I like the simpler style. |
Glad you like it, definitely needed it for Policyfiles. We could add deprecation warnings for array-style usage for a few releases just so we don't blindside anyone. |
I agree a deprecation warning would be great. I cannot recall why we went with arrays in the first place, but maps look very nice |
…than an array of hashes. Policyfiles with includes do not allow merging arrays and it's a bit unclear why an array was chosen. This patch does not change the existing behavior, only supplements it. Signed-off-by: Matt Ray <matthewhray@gmail.com>
I've updated the PR with a deprecation warning.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, much appreciated guys!
Due to #328 we must update the README.md to remove references to the Array of Hashes syntax. ```ruby default['audit']['profiles'] = [] default['audit']['profiles'].push( name: 'example', compliance: 'admin/example' ) ``` becomes ```ruby default['audit']['profiles'] = {} default['audit']['profiles']['example'] = { compliance: 'admin/example' } ``` Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
Note #339 where hash of hashes, the new hotness being shown as the replacement for the other 2 methods... doesn't actually work. |
@jblaine here's a working example: |
Due to #328 we must update the README.md to remove references to the Array of Hashes syntax. ```ruby default['audit']['profiles'] = [] default['audit']['profiles'].push( name: 'example', compliance: 'admin/example' ) ``` becomes ```ruby default['audit']['profiles'] = {} default['audit']['profiles']['example'] = { compliance: 'admin/example' } ``` Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
* Remove deprecated examples using Array of Hashes Due to #328 we must update the README.md to remove references to the Array of Hashes syntax. ```ruby default['audit']['profiles'] = [] default['audit']['profiles'].push( name: 'example', compliance: 'admin/example' ) ``` becomes ```ruby default['audit']['profiles'] = {} default['audit']['profiles']['example'] = { compliance: 'admin/example' } ``` Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com> * Update readme to remove compliance example Signed-off-by: Alex Pop <apop@chef.io>
Policyfiles with includes do not allow merging arrays and it's a bit unclear why an array was chosen. This patch does not change the existing behavior, only supplements it.
Signed-off-by: Matt Ray matthewhray@gmail.com