diff options
author | John Keiser <john@johnkeiser.com> | 2015-07-29 17:25:20 -0600 |
---|---|---|
committer | John Keiser <john@johnkeiser.com> | 2015-07-29 17:25:20 -0600 |
commit | 96053ccb88f145a1f6a354cfe709bc99176723cb (patch) | |
tree | db0ae0c5f8f53b0f2f490d3138c11d192c264a88 /lib/chef/mixin/params_validate.rb | |
parent | 28e20d62f3dcb29f34c2f67b41a1b486108f388d (diff) | |
download | chef-96053ccb88f145a1f6a354cfe709bc99176723cb.tar.gz |
Flatten regex validation array so nested arrays work
Diffstat (limited to 'lib/chef/mixin/params_validate.rb')
-rw-r--r-- | lib/chef/mixin/params_validate.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/mixin/params_validate.rb b/lib/chef/mixin/params_validate.rb index 322caea474..1b3a8ddcae 100644 --- a/lib/chef/mixin/params_validate.rb +++ b/lib/chef/mixin/params_validate.rb @@ -291,7 +291,7 @@ class Chef def _pv_regex(opts, key, regex) value = _pv_opts_lookup(opts, key) if !value.nil? - Array(regex).each do |r| + Array(regex).flatten.each do |r| return true if r.match(value.to_s) end raise Exceptions::ValidationFailed, "Option #{key}'s value #{value} does not match regular expression #{regex.inspect}" |