Sha256: eb75efba3798edbe071c80800852d4198227598c255273401fdbda3e0e502d2c
Contents?: true
Size: 742 Bytes
Versions: 6
Compression:
Stored size: 742 Bytes
Contents
module Host::ManagedExtensions extend ActiveSupport::Concern included do # execute standard callbacks after_validation :queue_reboot belongs_to :discovery_rule end def queue_reboot return if new_record? # Discovered Hosts already exist, and new_records will break `find` return unless type_changed? and ::Host::Base.find(self.id).type == "Host::Discovered" post_queue.create(:name => _("Rebooting %s") % self, :priority => 10000, :action => [self, :setReboot]) end def setReboot old.becomes(Host::Discovered).reboot end def delReboot # nothing to do here, in reality we should never hit this method since this should be the # last action in the queue. end end
Version data entries
6 entries across 6 versions & 1 rubygems