summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #7982 from chef/multi_packageTim Smith2020-04-172-43/+107
|\ | | | | Add multipackage support to homebrew
| * Use lamont's magic error handlingTim Smith2020-04-171-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tiny tweak to grab the first item so we actually get the hash back in the error handling. Given: ```ruby package %w{curl totally_junk_pkg} do action :upgrade end ``` ``` * No candidate version available for totally_junk_pkg ================================================================================ Error executing action `upgrade` on resource 'homebrew_package[curl, totally_junk_pkg]' ================================================================================ Chef::Exceptions::Package ------------------------- No candidate version available for totally_junk_pkg ``` Signed-off-by: Tim Smith <tsmith@chef.io>
| * Return empty hash from brew_info and avoid a bunch of nil checksmulti_packageTim Smith2020-04-171-8/+3
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Use package_name_arrayTim Smith2020-04-171-1/+1
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Properly handle unavailable packagesTim Smith2020-04-171-3/+22
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Use select instead of mapTim Smith2020-04-171-2/+2
| | | | | | | | | | | | It makes more sense when you read it Signed-off-by: Tim Smith <tsmith@chef.io>
| * Use .map.compact instead of filter_map to support ruby 2.6Tim Smith2020-04-171-2/+3
| | | | | | | | | | | | I left a note to kill this later Signed-off-by: Tim Smith <tsmith@chef.io>
| * Chefstyle fixesTim Smith2020-04-171-1/+1
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Rework how upgrades workTim Smith2020-04-161-8/+11
| | | | | | | | | | | | See the comment for why I had to do this Signed-off-by: Tim Smith <tsmith@chef.io>
| * Update specs for brew_cmd_outputTim Smith2020-04-161-2/+0
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Squash 2 methods into oneTim Smith2020-04-161-12/+8
| | | | | | | | | | | | This helper didn't help much Signed-off-by: Tim Smith <tsmith@chef.io>
| * Improve the trace logTim Smith2020-04-161-1/+1
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Improve the homebrew_user description for documentationTim Smith2020-04-161-1/+1
| | | | | | | | | | | | This can be a name or UID Signed-off-by: Tim Smith <tsmith@chef.io>
| * Reduce comment liesTim Smith2020-04-161-1/+1
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Use .compact to remove nil valuesTim Smith2020-04-161-6/+3
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Support working with package aliasesTim Smith2020-04-161-5/+28
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Make sure we concat an package_name as an arrayTim Smith2020-04-161-1/+1
| | | | | | | | | | | | This prevents the non-array form from breaking things Signed-off-by: Tim Smith <tsmith@chef.io>
| * WIP: Add multipackage support to homebrewTim Smith2020-04-161-26/+46
| | | | | | | | | | | | | | | | | | Issues: - If you try to remove a package that doesn't exist it explodes - If you try to use a package by its alias name it will blow up. Exampe: package 'golang' instead of 'go'. The hash of available packages will get built with 'go' as that's the package name - versions are pretty much ignored, but I think that makes sense with homebrew. It's a roll forward package system so you can't install a specific version. That's just not a concept of the package system. Signed-off-by: Tim Smith <tsmith@chef.io>
* | The value property in windows_env is not required for deletelcg/required-properties-chef-16Lamont Granquist2020-04-171-1/+1
| | | | | | | | | | | | Good example of why this is breaking, but this is better. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Force requiring propertiesLamont Granquist2020-04-172-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All required properties are now required for all actions by default even if the action does not reference the property. In order to only make the property required for a subset of the actions, specify them as an array of symbols to the required options on the property. ``` property :whatever, String, required: %i{start stop} action :start do end action :stop do end action :enable do end action :disable do end ``` That property will be required for start+stop but not for enable+disable. There's an unaddressed edge case here where if you reference the property in an action which was not specified that it will also fail validation. That is correct behavior. We should probably dig into how to warn the user that they must either remove the reference to the property from that action or else to add the action to the list of required actions on the property. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Bump version to 16.0.220 by Chef Expeditorv16.0.220Chef Expeditor2020-04-171-1/+1
| | | | | | | | Obvious fix; these changes are the result of automation not creative thinking.
* | Bump version to 16.0.219 by Chef Expeditorv16.0.219Chef Expeditor2020-04-171-1/+1
| | | | | | | | Obvious fix; these changes are the result of automation not creative thinking.
* | Merge pull request #9646 from chef/lcg/bootstrap-options-cleanupTim Smith2020-04-1720-346/+313
|\ \ | | | | | | Knife bootstrap options cleanup
| * | Knife bootstrap options cleanupLamont Granquist2020-04-1720-346/+313
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have issue that are caused by old code before merging of hash values were done correctly. The `config` hash correctly merges all options and should always be used. Knife plugins should never touch Chef::Config[:knife] values (either reading or writing from them). The `knife_config` should be converted to the `config` hash since it directly accesses Chef::Config[:knife] values. The `config_value()` helper should no longer be used. Very clearly most people started to use that when they should just use the config hash directly. That was intended to be used only when a knife cli option was being renamed and the former configuration value needed to be used as well. It has been cargo culted around as the way to access config values, and that should really stop. The DataBagSecretOption mixin has been cleaned up so that the cli options read+write only to the config[:cl_secret] and config[:cl_secret_file] values. The config file values go into config[:secret] and config[:secret_file]. The fact that those are the merged values in the `config` hash doesn't matter since only the cli should be writing to the first two and only the config file should be writing to the latter two. I don't know why it was made so complicated to begin with, but if there's some hidden chef-11.early backcompat there, then chef-16 deliberately breaks that. The use of `locate_config_value` helpers in all knife plugins is also discouraged (but they all implement those themselves), just use the config hash, which has the correct hash merge ordering. All of those need to be deleted. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | | Bump version to 16.0.218 by Chef Expeditorv16.0.218Chef Expeditor2020-04-171-1/+1
| | | | | | | | | | | | Obvious fix; these changes are the result of automation not creative thinking.
* | | Bump version to 16.0.217 by Chef Expeditorv16.0.217Chef Expeditor2020-04-171-1/+1
| | | | | | | | | | | | Obvious fix; these changes are the result of automation not creative thinking.
* | | Fix platform_version Chef::VersionString APILamont Granquist2020-04-161-5/+17
| | | | | | | | | | | | | | | | | | | | | The consumption of ohai attributes by the ohai segment plugin code was breaking this feature. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | | Bump version to 16.0.216 by Chef Expeditorv16.0.216Chef Expeditor2020-04-171-1/+1
| | | | | | | | | | | | Obvious fix; these changes are the result of automation not creative thinking.
* | | Add back the missing require on OhaiTim Smith2020-04-161-0/+1
| | | | | | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* | | Merge ohai resource / provider into a single resourceTim Smith2020-04-163-48/+18
| |/ |/| | | | | | | | | Simplify this resource and squash some files Signed-off-by: Tim Smith <tsmith@chef.io>
* | Bump version to 16.0.215 by Chef Expeditorv16.0.215Chef Expeditor2020-04-161-1/+1
| | | | | | | | Obvious fix; these changes are the result of automation not creative thinking.
* | Ruby 2.7 fix for powershell_outlcg/ruby-2.7-6Lamont Granquist2020-04-161-1/+1
| | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Bump version to 16.0.214 by Chef Expeditorv16.0.214Chef Expeditor2020-04-161-1/+1
| | | | | | | | Obvious fix; these changes are the result of automation not creative thinking.
* | msu pkg removal also requires timeoutdheerajd-msys2020-04-161-0/+1
| | | | | | | | Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>
* | Bump version to 16.0.213 by Chef Expeditorv16.0.213Chef Expeditor2020-04-161-1/+1
| | | | | | | | Obvious fix; these changes are the result of automation not creative thinking.
* | Merge pull request #9666 from chef/eol_release_warningTim Smith2020-04-151-0/+15
|\ \ | | | | | | Add a warning to the end of the chef run for EOL releses
| * | Simplify the logic + improve the specTim Smith2020-04-151-8/+5
| | | | | | | | | | | | | | | | | | | | | Use 2006 as the base year. Chef 15 goes EOL next year on 5-1-2021 so 2006 + 15 = 2021 and then we know it. Signed-off-by: Tim Smith <tsmith@chef.io>
| * | Add a warning to the end of the chef run for EOL releseseol_release_warningTim Smith2020-04-151-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We really want to encourage people to upgrade. One way we can do this is to just warn them that they're on an EOL release. This simple warning might nudge them to upgrade their client. It's works off the base EOL data of Chef 15 and takes the current release to add to that date. That way we don't have to maintain anything and as long as we keep a yearly release we're good. If we change the schedule then we either remove this or update the logic. That's a risk in shipping code that doesn't fire for 2 years. Signed-off-by: Tim Smith <tsmith@chef.io>
* | | Bump version to 16.0.212 by Chef Expeditorv16.0.212Chef Expeditor2020-04-151-1/+1
| | | | | | | | | | | | Obvious fix; these changes are the result of automation not creative thinking.
* | | Merge pull request #9649 from ↵Tim Smith2020-04-153-1/+7
|\ \ \ | |/ / |/| | | | | | | | MsysTechnologiesllc/dh/fix-msu-pkg-cumulative-update msu_package: Fix cumulative updates installation and provide a 3600s default timeout
| * | add timeout propertydheerajd-msys2020-04-143-1/+7
| | | | | | | | | | | | Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>
| * | fix msu pkg cumulative updatesdheerajd-msys2020-04-141-2/+2
| | | | | | | | | | | | Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>
* | | Bump version to 16.0.211 by Chef Expeditorv16.0.211Chef Expeditor2020-04-151-1/+1
| |/ |/| | | | | Obvious fix; these changes are the result of automation not creative thinking.
* | Bump version to 16.0.210 by Chef Expeditorv16.0.210Chef Expeditor2020-04-151-1/+1
| | | | | | | | Obvious fix; these changes are the result of automation not creative thinking.
* | Replace a few uses of attributes / parameters in messaging with propertiesTim Smith2020-04-152-5/+5
| | | | | | | | | | | | I think we may finally have them all now. Signed-off-by: Tim Smith <tsmith@chef.io>
* | Bump version to 16.0.209 by Chef Expeditorv16.0.209Chef Expeditor2020-04-141-1/+1
| | | | | | | | Obvious fix; these changes are the result of automation not creative thinking.
* | Merge pull request #9659 from chef/timeoutsTim Smith2020-04-1413-31/+39
|\ \ | |/ |/| Updates to timeout properties in various resources
| * Give execute resource a proper timeout defaulttimeoutsTim Smith2020-04-132-8/+3
| | | | | | | | | | | | This should just be done on the resource instead of hacking it into the provider Signed-off-by: Tim Smith <tsmith@chef.io>
| * Updates to timeout properties in resourcesTim Smith2020-04-1312-23/+36
| | | | | | | | | | | | | | | | | | 1) make sure they all have desired state false 2) Fix some indentation 3) Fix portage_package to have a type of String/Integer to match package 4) Add the String type to paludis_package to match the package default Signed-off-by: Tim Smith <tsmith@chef.io>
* | Bump version to 16.0.208 by Chef Expeditorv16.0.208Chef Expeditor2020-04-141-1/+1
|/ | | | Obvious fix; these changes are the result of automation not creative thinking.