Issue #7573 has been updated by Zach Leslie.

Status changed from Unreviewed to Accepted


----------------------------------------
Bug #7573: Search action on some indirector faces can never be invoked over 
REST due to bug #7004
https://projects.puppetlabs.com/issues/7573

Author: Nick Fagerlund
Status: Accepted
Priority: Normal
Assignee: 
Category: Faces
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


It is currently impossible to call the search action on `resource_type` (or 
certificate, or resource) when you specify `--terminus rest`. 

    nick@magpie:~$ puppet resource_type --terminus rest --server 
redmaster.magpie.lan search '*'
    
    warning: peer certificate won't be verified in this SSL session
    err: Could not call 'search' on 'resource_type': Error 400 on SERVER: Could 
not find indirection 'resource_typ'
    err: Try 'puppet help resource_type search' for usage

Note the truncated indirection name. I am positive this is related to bug 
#7004. 

When using the REST API, you can work around the busted pluralization magic by 
using the `resource_type_search` endpoint instead. Until we can stabilize this 
annoying faux-English-plural business for search methods, indirector faces 
should always be constructing their REST requests using the reliable `_search` 
alias.

Unfortunately, it looks like these URLs are being constructed pretty deep in 
Puppet's guts, so it's not just a matter of changing 
lib/puppet/indirector/face.rb: 

    def call_indirection_method(method, key, options)
      begin
        result = indirection.__send__(method, key, options)
      rescue => detail
        puts detail.backtrace if Puppet[:trace]
        raise "Could not call '#{method}' on '#{indirection_name}': #{detail}"
      end
  
      return result
    end

On the plus side, I'm guessing fixing it where it lives should solve this 
problem for good if we ever end up using search methods somewhere else in 
Puppet. (We can't be using them for anything in core yet, right?)


-- 
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