Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #76 from ares/master
Browse files Browse the repository at this point in the history
Fix settings values to be strings
  • Loading branch information
ares committed Aug 20, 2014
2 parents c1d5149 + 03b59e5 commit 570db47
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions bin/staypuft-installer
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def module_enabled?(name)
end

def get_param(mod, name)
@result.param(mod, name).value
param = @result.param(mod, name)
param.nil? ? nil : param.value
end

# functions specific to foreman installer
Expand Down Expand Up @@ -61,7 +62,7 @@ if [0,2].include? @result.exit_code
# Foreman UI?
if module_enabled? 'foreman'
say " * <%= color('Foreman', :info) %> is running at <%= color('#{get_param('foreman','foreman_url')}', :info) %>"
say " Default credentials are '<%= color('admin:changeme', :info) %>'" if get_param('foreman','authentication') == true
say " Initial credentials are <%= color('#{get_param('foreman', 'admin_username') || 'admin'}', :info) %> / <%= color('#{get_param('foreman', 'admin_password') || 'changeme'}', :info) %>" if get_param('foreman','authentication') == true
end

# Proxy?
Expand Down
4 changes: 2 additions & 2 deletions hooks/lib/provisioning_seeder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,15 @@ def setup_setting(default_hostgroup)

def setup_idle_timeout
@foreman.setting.show_or_ensure({'id' => 'idle_timeout'},
{'value' => 180})
{'value' => @foreman.version.start_with?('1.6') ? 180 : '180'})
rescue NoMethodError => e
@logger.error "Setting with name 'idle_timeout' not found, you must run 'foreman-rake db:seed' " +
"and rerun installer to fix this issue."
end

def setup_ignore_puppet_facts_for_provisioning
@foreman.setting.show_or_ensure({'id' => 'ignore_puppet_facts_for_provisioning'},
{'value' => true})
{'value' => @foreman.version.start_with?('1.6') ? true : 'true'})
rescue NoMethodError => e
@logger.error "Setting with name 'ignore_puppet_facts_for_provisioning' not found, you must run 'foreman-rake db:seed' " +
"and rerun installer to fix this issue."
Expand Down

0 comments on commit 570db47

Please sign in to comment.