Revision db559817
Added by Dominic Cleal about 9 years ago
app/models/host/base.rb | ||
---|---|---|
# we can't use SQL, we need to get even unsaved objects
|
||
interface = self.interfaces.detect(&flag)
|
||
|
||
interface.host = self if interface # inverse_of does not help (STI), but ignore this on deletion (interface is not found)
|
||
interface.host = self if interface && !interface.destroyed? # inverse_of does not help (STI), but ignore this on deletion
|
||
instance_variable_set(cache, interface)
|
||
end
|
||
end
|
Also available in: Unified diff
fixes #10298 - handle destroyed but present interfaces
When deleting a host and DHCP orchestration is removing reservations for NICs,
it generates a dhcp_record that contains next-server data. Determining the
next-server IP causes the primary interface to be fetched for DNS resolution,
to resolve the next-server hostname:
get_interface_by_flag no longer attempts to modify the interface when it is
being deleted.