summaryrefslogtreecommitdiff
path: root/lib/chef/mixin
Commit message (Collapse)AuthorAgeFilesLines
* replace usages of Cmdlet class with powershell_execmwrock2020-11-301-1/+3
| | | | Signed-off-by: mwrock <matt@mattwrock.com>
* Simplify regexes by removing extra character classesTim Smith2020-10-301-1/+1
| | | | | | We're working too hard here. No need for these. Signed-off-by: Tim Smith <tsmith@chef.io>
* Merge repetitive conditionalsTim Smith2020-10-271-1/+1
| | | | | | So much easier to read and probably faster this way too. Signed-off-by: Tim Smith <tsmith@chef.io>
* Merge pull request #10520 from chef/lwrp_cleanupTim Smith2020-10-191-0/+2
|\ | | | | Move the alias for attribute to property right into the property mixin
| * Move the alias for attribute to property right into the property mixinlwrp_cleanupTim Smith2020-10-161-0/+2
| | | | | | | | | | | | Stick it right next to the property def so it's pretty obvious how this works. Signed-off-by: Tim Smith <tsmith@chef.io>
* | Remove constantize method from Chef::Mixin::ConvertToClassNameTim Smith2020-10-161-56/+0
|/ | | | | | | It doesn't look like we're using this anymore and the comment states that we wouldn't need the implementation after Ruby 2.0 anyways. Signed-off-by: Tim Smith <tsmith@chef.io>
* Merge pull request #10476 from chef/exec_coreTim Smith2020-10-051-10/+22
|\ | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * remove redundant codemwrock2020-10-011-8/+1
| | | | | | | | Signed-off-by: mwrock <matt@mattwrock.com>
| * add interpreter arg to powershell_exec allowing it to run powershell coremwrock2020-10-011-10/+29
| | | | | | | | Signed-off-by: mwrock <matt@mattwrock.com>
* | add interpreter arg to powershell_out allowing it to call pwsh.exemwrock2020-10-011-5/+12
|/ | | | Signed-off-by: mwrock <matt@mattwrock.com>
* Merge pull request #10463 from 007lva/chore/use-ruby-2.6-endless-rangeTim Smith2020-09-251-1/+1
|\ | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Use Ruby 2.6 endless Range syntax007lva2020-09-241-1/+1
| | | | | | | | Signed-off-by: Luigi <007.lva@gmail.com>
* | autoload addressable/uri on :URI inside addressable modulemwrock2020-09-241-1/+3
|/ | | | Signed-off-by: mwrock <matt@mattwrock.com>
* Update lib/chef/mixin/versioned_api.rb Tim Smith2020-09-161-1/+1
| | | | | Signed-off-by: Tim Smith <tsmith@chef.io> Co-authored-by: pete higgins <pete@peterhiggins.org>
* Resolve Style/RedundantSort warningsTim Smith2020-09-161-2/+1
| | | | | | Avoid a sort then last and just grab the max. Signed-off-by: Tim Smith <tsmith@chef.io>
* use autoloading for many required gemsmwrock2020-09-083-8/+5
| | | | Signed-off-by: mwrock <matt@mattwrock.com>
* Fix nil deep_merginglcg/fix-nil-deep-mergeLamont Granquist2020-09-031-12/+0
| | | | | | | | | | | | | | | | | While this behavior was fixed for attributes a long, long time ago it turns out we don't use this deep_merge mixin for constructing the deep merge of attribute precedence levels any more. This bug however surfaces because we still use deep_merge to merge json attributes into normal attributes. That means that it is not possible to pass a nil / null value in through -j and have it override a normal attribute which is pulled back in from the node object on the chef-server. So this fixes that behavior to be consistent with the behavior of attributes that we've had for several years now. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Simplify implementation for checksum ellipsisThomas Heinen2020-08-171-4/+0
| | | | Signed-off-by: Thomas Heinen <theinen@tecracer.de>
* Change output to clearly show checksums are displayed incompletelyThomas Heinen2020-08-141-0/+3
| | | | Signed-off-by: Thomas Heinen <theinen@tecracer.de>
* Optimize requires for non-omnibus installsrequire_optimizationTim Smith2020-08-122-2/+2
| | | | | | | Only require external libraries if we need to. Also use require_relative everywhere we can. Signed-off-by: Tim Smith <tsmith@chef.io>
* Mark deep_merge as privateLamont Granquist2020-08-071-6/+35
| | | | | | | It ain't quite private, but if people find it useful but not quite what they want they need to maintain their own implementation. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Convert openssl resources to unified_modeLamont Granquist2020-08-031-1/+3
| | | | | | | | | | | | | | | Mostly does what the title says, there wasn't much that depended on compile/converge ordering and mostly this might fix a bug or two in intention. Renamed a method that had a misspelling. Used tap in two places. Removed the mutation of the new_resource in two places which is the most disruptive part of this change. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix el6 selinuxLamont Granquist2020-07-241-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Fix default_paths patchLamont Granquist2020-07-232-6/+6
| | | | | | | Fixing a few things that may have broken selinux on EL6 through 'which' support. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Convert to default_paths APIlcg/default-pathsLamont Granquist2020-07-223-8/+41
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* clean up the chefutils wiring with a common helper classlcg/extract-mixlib-shelloutLamont Granquist2020-07-213-20/+44
| | | | | | also fixes a FIXME in the YARD Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* just code changes, no spec modificationsLamont Granquist2020-07-212-183/+18
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Look for openssl.cnf if it is not in the default location.fix-windows-openssl-conf-testPete Higgins2020-07-091-3/+26
| | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* Merge pull request #10123 from chef/assignmentTim Smith2020-07-071-2/+1
|\ | | | | Avoid assigning variables before returning if we don't have to
| * Avoid assigning variables before returning if we don't have toTim Smith2020-07-071-2/+1
| | | | | | | | | | | | These seemed pretty straight forward. There's a new Rubocop cop for these. Signed-off-by: Tim Smith <tsmith@chef.io>
* | Add spaces after attrsTim Smith2020-07-071-0/+1
|/ | | | | | This makes it easier to read the classes. Signed-off-by: Tim Smith <tsmith@chef.io>
* Use .match? not =~ when match values aren't necessaryTim Smith2020-06-111-2/+2
| | | | | | Autocorrected from RuboCop Performance which is now smart enough to detect when you use the match and when you don't. Using match? does not create any objects so it's slightly faster and uses less memory. Signed-off-by: Tim Smith <tsmith@chef.io>
* Update our usage of OpenSSL::Digest to avoid Ruby 3 breaking changeopenssl_fixesTim Smith2020-05-221-4/+4
| | | | | | There's a RuboCop cop to fix these before Ruby 3 breaks it. Signed-off-by: Tim Smith <tsmith@chef.io>
* Remove an unused require.Pete Higgins2020-05-191-1/+0
| | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* Get lib/ free of spelling violations.Pete Higgins2020-05-183-4/+4
| | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* Fix a small rdoc formatting bug for `copy_properties_from`.Pete Higgins2020-05-061-0/+2
| | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* Align all our comments with the codeTim Smith2020-05-061-8/+8
| | | | | | Autocorrected with chefstyle after enabling that cop. It was very hard to read some complex autocorrected blocks w/o this. Signed-off-by: Tim Smith <tsmith@chef.io>
* Add .error! for powershell_execTim Smith2020-04-261-1/+10
| | | | | | This matches powershell_out and it's something we need to easily migrate resources to the new helper. Signed-off-by: Tim Smith <tsmith@chef.io>
* Ruby 2.7 fix for powershell_outlcg/ruby-2.7-6Lamont Granquist2020-04-161-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Replace a few uses of attributes / parameters in messaging with propertiesTim Smith2020-04-151-4/+4
| | | | | | I think we may finally have them all now. Signed-off-by: Tim Smith <tsmith@chef.io>
* Remove copyright dateslcg/remove-copyright-datesLamont Granquist2020-04-1334-35/+35
| | | | | | | | Legally incredibly dubious, particularly since we don't follow it strictly as policy, and we have git history instead, which does it right. This is just a waste of time and a cargo cult. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Revert someVivek Singh2020-04-061-1/+1
| | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Fix typoVivek Singh2020-04-065-8/+8
| | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Change name_property to be identity and not desired_state by defaultLamont Granquist2020-04-021-1/+13
| | | | | | | | If no other property is an identity property then the name_property is the default identity property. The name_property is also marked as not being desired state by default (the 'name' should never change). Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Remove outdated comment about shell args on different platforms.remove-outdated-commentPete Higgins2020-03-201-4/+0
| | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* Update all our links to use the new docs site formatTim Smith2020-03-041-1/+1
| | | | | | When we migrated to hugo the URLs changed a bit. Nothing ends in .html and we moved all the resources into their own dir. Signed-off-by: Tim Smith <tsmith@chef.io>
* Removed useless checkJulien Huon2019-12-251-3/+0
| | | | Signed-off-by: Julien Huon <julien@huon.email>
* Fix chefstyle errorsJulien Huon2019-12-251-2/+2
| | | | Signed-off-by: Julien Huon <julien@huon.email>
* Add the capability to automatically renew a certificate with ↵Julien Huon2019-12-251-0/+24
| | | | | | x509_certificate resource Signed-off-by: Julien Huon <julien@huon.email>
* Add chef-utils gem with various recipe DSL helpersLamont Granquist2019-11-0811-161/+36
| | | | | | | | | | | | | This is the implementation of [RFC-087](https://github.com/chef-boneyard/chef-rfc/blob/master/rfc087-distro-sugar-helpers.md) although some of the specifics have been iterated on and changed. The documentation will be in the [README.md](https://github.com/chef/chef/tree/master/chef-utils/README.md) once this is merged. While this PR mostly moves chef-sugar utilities into core-chef via this chef-utils gem, the scope of the chef-utils gem should be considered larger than just that. As an example this PR moves the Mash class into this gem for reuse in ohai as well. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>