Project

General

Profile

« Previous | Next » 

Revision 3cdaa292

Added by Dmitri Dolguikh about 10 years ago

Fixes #4851: a SmartProxy.with_features scope replaces feature-specific scopes generated during class loading

View differences:

app/models/environment.rb
# returns an hash of all puppet environments and their relative paths
def puppetEnvs proxy = nil
url = (proxy || SmartProxy.puppet_proxies.first).try(:url)
url = (proxy || SmartProxy.with_features("Puppet").first).try(:url)
raise ::Foreman::Exception.new(N_("Can't find a valid Foreman Proxy with a Puppet feature")) if url.blank?
proxy = ProxyAPI::Puppet.new :url => url
HashWithIndifferentAccess[proxy.environments.map { |e|

Also available in: Unified diff