Revision d9a2ebac
Added by Ohad Levy almost 12 years ago
- ID d9a2ebac6e9ec0082e60265b794f54a29a1f7e65
app/helpers/hosts_and_hostgroups_helper.rb | ||
---|---|---|
ca = SmartProxy.joins(:features).where(:features => { :name => "Puppet CA" })
|
||
proxies = SmartProxy.joins(:features).where(:features => { :name => "Puppet" })
|
||
# do not show the ca proxy, if we have only one of those and its the same as the puppet proxy
|
||
fields = puppet_ca(f) unless ca.count == 1 and ca.map(&:id) == proxies.map(&:id)
|
||
fields = puppet_ca(f) unless ca.to_a.count == 1 and ca.map(&:id) == proxies.map(&:id)
|
||
"#{fields} #{puppet_master(f)}".html_safe
|
||
end
|
||
|
||
... | ... | |
return unless SETTINGS[:unattended]
|
||
proxies = SmartProxy.joins(:features).where(:features => { :name => "Puppet CA" })
|
||
select_f f, :puppet_ca_proxy_id, proxies, :id, :name,
|
||
{ :include_blank => proxies.count > 1 },
|
||
{ :include_blank => proxies.to_a.count > 1 },
|
||
{ :label => "Puppet CA",
|
||
:help_inline => "Use this puppet server as a CA server" }
|
||
end
|
||
... | ... | |
def puppet_master f
|
||
proxies = SmartProxy.joins(:features).where(:features => { :name => "Puppet" })
|
||
select_f f, :puppet_proxy_id, proxies, :id, :name,
|
||
{ :include_blank => proxies.count > 1 },
|
||
{ :include_blank => proxies.to_a.count > 1 },
|
||
{ :label => "Puppet Master",
|
||
:help_inline => "Use this puppet server as an initial Puppet Server or to execute puppet runs" }
|
||
end
|
Also available in: Unified diff
[SQL optimizations] - many small optimizations
This is one of a few patches aim to improve Foreman performance