Bug #1566

Puppet CA set incorrectly when only one proxy is defined

Added by Greg Sutcliffe about 1 year ago. Updated about 1 year ago.

Status:Closed Start:04/04/2012
Priority:Normal Due date:
Assigned to:Greg Sutcliffe % Done:

100%

Category:Host creation
Target version:1.0
Backlog:No Difficulity:
Votes: 2 (View)

Description

This is related to the way a combo-box defaults to "blank" even when there is only one valid option. Because we hide the rendering of the combobox when there is only one puppet proxy, it can't be set to the right value.

Need to investigate why the proxy isn't being set to the only valid option when there's only one proxy.

Associated revisions

Revision abc126551b89739f7dd714fe053ad8089848b93a
Added by Ohad Levy about 1 year ago

fixes #1566 - Puppet CA set incorrectly when only one proxy is defined

History

Updated by Greg Sutcliffe about 1 year ago

You can work around this with this patch:

diff --git a/app/helpers/hosts_and_hostgroups_helper.rb b/app/helpers/hosts_and_hostgroups_
index d03c609..885a2e7 100644
--- a/app/helpers/hosts_and_hostgroups_helper.rb
+++ b/app/helpers/hosts_and_hostgroups_helper.rb
@@ -63,7 +63,7 @@ module HostsAndHostgroupsHelper
     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 puppe
-    fields =  puppet_ca(f) unless ca.count == 1 and ca.map(&:id) == proxies.map(&:id)
+    fields =  puppet_ca(f) unless ca.count == 0 and ca.map(&:id) == proxies.map(&:id)
     "#{fields} #{puppet_master(f)}".html_safe
   end


Although you'll have to edit your hosts again :(

Updated by Ohad Levy about 1 year ago

  • Category set to Host creation
  • Target version set to 1.0

Updated by Ohad Levy about 1 year ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF