Project

General

Profile

« Previous | Next » 

Revision a406cf2b

Added by Matěj Mudra 8 months ago

fixes #36160 - Redefine append domain names setting

This PR aims to unify the format of host names stored in the database and the way they are displayed.
With this change, the name of the host is always going to be stored with the domain name appended.
The setting formerly named `append_domain_name_for_hosts` is now renamed to `display_fqdn_for_hosts`
because it will only impact how the names are displayed from now.
This means dashboards and breadcrumbs are going to display the whole FQDN if you choose to.

View differences:

test/controllers/api/v2/settings_controller_test.rb
end
test "should get all settings through index" do
Setting['append_domain_name_for_hosts'] = false
Setting['display_fqdn_for_hosts'] = false
get :index, params: { per_page: 'all' }
assert_response :success
settings = ActiveSupport::JSON.decode(@response.body)['results']
......
foreman_url = settings.detect { |s| s['name'] == 'foreman_url' }
assert_equal Setting['foreman_url'], foreman_url['value']
assert_equal Foreman.settings.find('foreman_url').default, foreman_url['default']
append_domain_name_for_hosts = settings.detect { |s| s['name'] == 'append_domain_name_for_hosts' }
assert_equal false, append_domain_name_for_hosts['value']
display_fqdn_for_hosts = settings.detect { |s| s['name'] == 'display_fqdn_for_hosts' }
assert_equal false, display_fqdn_for_hosts['value']
end
test "should get index with organization and location params" do
......
end
test "properly show overriden false value" do
Setting['append_domain_name_for_hosts'] = value = false
get :show, params: { :id => 'append_domain_name_for_hosts' }
Setting['display_fqdn_for_hosts'] = value = false
get :show, params: { :id => 'display_fqdn_for_hosts' }
assert_response :success
show_response = ActiveSupport::JSON.decode(@response.body)
assert_equal value, show_response['value']

Also available in: Unified diff