diff options
author | Phil Dibowitz <phil@ipom.com> | 2015-08-20 13:37:34 -0700 |
---|---|---|
committer | Phil Dibowitz <phil@ipom.com> | 2015-08-21 14:54:52 -0700 |
commit | b972d25ff0df05a96b9cb909fedd9047a4066642 (patch) | |
tree | b02a78304001df35c69c6a71eaffe370e50a4c01 | |
parent | 88752a692e8a17a44174e7f6411b58790684d141 (diff) | |
download | chef-b972d25ff0df05a96b9cb909fedd9047a4066642.tar.gz |
Validating is comparing to true instead of ruby truthiness
It should use truthiness.
-rw-r--r-- | CHANGELOG.md | 3 | ||||
-rw-r--r-- | lib/chef/mixin/params_validate.rb | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index e90b2bc35d..360becccb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,8 @@ [pr#3594](https://github.com/chef/chef/pull/3594): Update service provider for OSX 10.11 * [**Nate Walck**](https://github.com/natewalck): [pr#3704](https://github.com/chef/chef/pull/3704): Add SIP (OS X 10.11) support - +* [**Phil Dibowitz**](https://github.com/jaymzh): + [pr#3805](https://github.com/chef/chef/pull/3805): LWRP parameter validators should use truthiness * [pr#3774](https://github.com/chef/chef/pull/3774) Add support for yum-deprecated in yum provider * [pr#3793](https://github.com/chef/chef/pull/3793) CHEF-5372: Support specific `run_levels` for RedHat service * [pr#2460](https://github.com/chef/chef/pull/2460) add privacy flag diff --git a/lib/chef/mixin/params_validate.rb b/lib/chef/mixin/params_validate.rb index 1b3a8ddcae..e3c7657b1b 100644 --- a/lib/chef/mixin/params_validate.rb +++ b/lib/chef/mixin/params_validate.rb @@ -315,7 +315,7 @@ class Chef value = _pv_opts_lookup(opts, key) if !value.nil? callbacks.each do |message, zeproc| - if zeproc.call(value) != true + unless zeproc.call(value) raise Exceptions::ValidationFailed, "Option #{key}'s value #{value} #{message}!" end end |