diff options
| author | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-29 17:24:18 -0700 |
|---|---|---|
| committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-05-02 10:08:26 -0700 |
| commit | b23cc8abec1a1ec41b554b4e72f9a3c21feaf9da (patch) | |
| tree | a0c8310b9a36b51c2566dfa7ef86ab421658ddd7 /lib/puppet/interface/action_builder.rb | |
| parent | 6815044fbc94c0d502b1061309d5aaeb8f791660 (diff) | |
| download | puppet-b23cc8abec1a1ec41b554b4e72f9a3c21feaf9da.tar.gz puppet-b23cc8abec1a1ec41b554b4e72f9a3c21feaf9da.tar.xz puppet-b23cc8abec1a1ec41b554b4e72f9a3c21feaf9da.zip | |
(#7282) action without `when_invoked` should fail...
We used to let actions be declared without the `when_invoked` block, which was
usually a sign of either someone writing their method code direct in action
declaration, or someone forgetting to add their code at all.
This was just let silently by: the error only showed up when you finally tried
to invoke the action, and a NoMethod error was raised by the face.
...except for our own testing. We took advantage of this a whole pile of
times in there; fixing the original UI issue means fixing all those too.
Reviewed-By: Nick Lewis <nick@puppetlabs.com>
Diffstat (limited to 'lib/puppet/interface/action_builder.rb')
| -rw-r--r-- | lib/puppet/interface/action_builder.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/puppet/interface/action_builder.rb b/lib/puppet/interface/action_builder.rb index afc49e945..0bf4f1408 100644 --- a/lib/puppet/interface/action_builder.rb +++ b/lib/puppet/interface/action_builder.rb @@ -69,5 +69,6 @@ class Puppet::Interface::ActionBuilder @face = face @action = Puppet::Interface::Action.new(face, name) instance_eval(&block) + @action.when_invoked or raise ArgumentError, "actions need to know what to do when_invoked; please add the block" end end |
