diff options
author | John Keiser <john@johnkeiser.com> | 2015-10-05 13:38:36 -0700 |
---|---|---|
committer | John Keiser <john@johnkeiser.com> | 2015-10-05 13:38:36 -0700 |
commit | 0053c17bba34090083a34395657ff1ba1616e213 (patch) | |
tree | 3f0234a43a070b46eebf62ed1f68a2c423f61e2e /lib/chef/event_dispatch | |
parent | def2fe69b82fb8f0f5feb6634f63d6a3dc78ca85 (diff) | |
download | chef-0053c17bba34090083a34395657ff1ba1616e213.tar.gz |
Fix dispatch when there are different receivers
with different numbers of arguments.
Fixes https://github.com/chef/chef-dk/issues/546)
Diffstat (limited to 'lib/chef/event_dispatch')
-rw-r--r-- | lib/chef/event_dispatch/dispatcher.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/chef/event_dispatch/dispatcher.rb b/lib/chef/event_dispatch/dispatcher.rb index 966a3f32ec..f3e55539a9 100644 --- a/lib/chef/event_dispatch/dispatcher.rb +++ b/lib/chef/event_dispatch/dispatcher.rb @@ -32,8 +32,11 @@ class Chef mth = s.method(method_name) # Trim arguments to match what the subscriber expects to allow # adding new arguments without breaking compat. - args = args.take(mth.arity) if mth.arity < args.size && mth.arity >= 0 - mth.call(*args) + if mth.arity < args.size && mth.arity >= 0 + mth.call(*args.take(mth.arity)) + else + mth.call(*args) + end end end |