Project

General

Profile

« Previous | Next » 

Revision 674755f4

Added by Ori Rabin almost 9 years ago

Fixes #10915 - Deleting a host removes all host specific overrides

View differences:

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
test 'check operatingsystem and architecture association' do
host = FactoryGirl.build(:host, :interfaces => [FactoryGirl.build(:nic_primary_and_provision)])
assert_nil Operatingsystem.find_by_name('RedHat-test'), "operatingsystem already exist"

Also available in: Unified diff