summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-03-25 10:38:40 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-03-25 10:38:40 -0700
commit88aeb04a50d8997b5e1e0ed7a5a2239508b174ee (patch)
tree2ab2be1218ceaf66238db55b78591c61e942e4b1
parent4c320cc482a33892a688d3a5072081e6d63a8310 (diff)
MAINT: fix the misordered invocations in action.
When initializing we need to set the name and interface before we do anything else, since the reasonable assumption for users is that those invariants are there when their setter is called. This allows someone to override the interface or name by misusing the call to new, but they could already screw up by passing the wrong values, so whatever.
-rw-r--r--lib/puppet/interface/action.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/puppet/interface/action.rb b/lib/puppet/interface/action.rb
index 1c19bd08c..1a5730d1b 100644
--- a/lib/puppet/interface/action.rb
+++ b/lib/puppet/interface/action.rb
@@ -7,9 +7,9 @@ class Puppet::Interface::Action
name = name.to_s
raise "'#{name}' is an invalid action name" unless name =~ /^[a-z]\w*$/
- attrs.each do |k,v| send("#{k}=", v) end
@interface = interface
- @name = name
+ @name = name
+ attrs.each do |k,v| send("#{k}=", v) end
end
def invoke(*args, &block)