Module: Nic::ManagedExtensions

Extended by:
ActiveSupport::Concern
Defined in:
app/models/nic/managed_extensions.rb

Instance Method Summary collapse

Instance Method Details

#del_discovery_rebuild_dnsObject



22
23
24
25
# File 'app/models/nic/managed_extensions.rb', line 22

def del_discovery_rebuild_dns
  # Just a place holder, so if rollback is needed, we won't get an exception about not knowing how to rollback.
  # This is a no-op, since we cannot really rollback rebuild_dns
end

#discovery_queue_rebuild_dnsObject



8
9
10
11
12
13
14
15
# File 'app/models/nic/managed_extensions.rb', line 8

def discovery_queue_rebuild_dns
  return unless (dns? || dns6? || reverse_dns? || reverse_dns6?) && errors.empty? && Setting[:discovery_always_rebuild_dns]
  return if self.host.new_record? || old.nil? # Discovered Hosts already exist, and new_records will break `find`
  return unless self.host.will_save_change_to_attribute?(:type, from: 'Host::Discovered')
  return if self.pending_dns_record_changes?
  logger.debug "Queuing DNS rebuild for #{self}"
  queue.create(:name => _("Rebuild DNS for %s") % self, :priority => 10, :action => [self, :set_discovery_rebuild_dns])
end

#set_discovery_rebuild_dnsObject



17
18
19
20
# File 'app/models/nic/managed_extensions.rb', line 17

def set_discovery_rebuild_dns
  logger.debug "Executing DNS rebuild for #{self}"
  rebuild_dns
end