Revision 31d4c6cb
Added by Ori Rabin almost 9 years ago
app/models/host/managed.rb | ||
---|---|---|
end
|
||
|
||
def lookup_value_match
|
||
"fqdn=#{fqdn}"
|
||
"fqdn=#{fqdn || name}"
|
||
end
|
||
|
||
def lookup_keys_params
|
test/unit/host_test.rb | ||
---|---|---|
assert_equal 'foo', host.shortname
|
||
end
|
||
|
||
test 'lookup_value_match returns host name instead of fqdn when there is no primary interface' do
|
||
host = FactoryGirl.build(:host, :managed)
|
||
host_name = host.name
|
||
host.interfaces.delete_all
|
||
assert_nil host.primary_interface
|
||
assert_equal host.send(:lookup_value_match), "fqdn=#{host_name}"
|
||
end
|
||
|
||
private
|
||
|
||
def parse_json_fixture(relative_path)
|
Also available in: Unified diff
Fixes #10915 - Deleting a host removes all host specific overrides
(cherry picked from commit 674755f43684f76e6b23ca499a57153aad3db5e2)