Issue #6985 has been updated by Josh Cooper.

Status changed from Available In Testing Branch to Closed

See commit:292a8b92c74c8d9392348ef6e9718934471a0ac1
----------------------------------------
Bug #6985: call_indirection_method should forward the options hash to the 
indirector 
https://projects.puppetlabs.com/issues/6985

Author: Dan Bode
Status: Closed
Priority: Normal
Assignee: 
Category: Faces
Target version: Statler
Affected Puppet version: 
Keywords: 
Branch: 


The following code from when_invoked specifies that an empty options has will 
only be appended when the last argument is not a hash.

<pre> 
   wrapper = "def #{@name}(*args, &block)
                 args << {} unless args.last.is_a? Hash
                 args << block if block_given?
                 self.__send__(#{internal_name.inspect}, *args)
               end"
</pre>

With indirectors, the last argument is always a hash

<pre>
cat_string = Puppet::String[:catalog, '0.0.1']
catalog = nil
if node.class == Puppet::Node
  catalog = cat_string.find(node.name, :use_node => node, :ignore_cache=>true)
</pre>

this does not work, b/c the call indirector method pops the hash off (which is 
the argument hash if one is provided)

<pre>
  def call_indirection_method(method, *args)
    options = args.pop
</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to