Both name and url are unique, I thought that url looks like the proper
id. We often get errors when users already specified a proxy by himself
under different name. With url matching I think there will be less
errors.

LZ

On Mon, Dec 02, 2013 at 12:37:03AM -0800, Dominic Cleal wrote:
> > @@ -16,11 +16,22 @@ def smartProxies
> >    end
> >  
> >    def proxy
> > -    @proxy ||= smartProxies.index[0].find { |s| s['smart_proxy']['name'] == resource[:name] }
> > +    if @proxy
> > +      @proxy
> > +    else
> > +      spi = smartProxies.index[0]
> > +      if spi.has_key?('results')
> > +        # foreman_api 0.1.18+
> > +        @proxy = spi['results'].find { |s| s['url'] == resource[:url] }
> > +      else
> 
> Why are we matching by URL here?
> 
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/theforeman/puppet-foreman/pull/130/files#r8019572

-- 
Later,

 Lukas "lzap" Zapletal
 irc: lzap #theforeman