Class: Itchy::EventHandlers::ExpirePostfixEventHandler

Inherits:
BaseEventHandler show all
Defined in:
lib/itchy/event_handlers/expire_postfix_event_handler.rb

Overview

Handler for ExpirePostfix event (image expired).

Constant Summary

Constants inherited from BaseEventHandler

BaseEventHandler::EVENT_FILE_REGEXP, BaseEventHandler::TEMPFILE_BASE

Instance Attribute Summary

Attributes inherited from BaseEventHandler

#options, #vmcatcher_configuration

Instance Method Summary collapse

Methods inherited from BaseEventHandler

#archive!, #initialize, #save_descriptor, #set_file_permissions

Constructor Details

This class inherits a constructor from Itchy::EventHandlers::BaseEventHandler

Instance Method Details

#handle!(vmcatcher_event, event_name) ⇒ Object

Handles an ExpirePostfix event.

Parameters:

  • vmcatcher_event (Itchy::VmcatcherEvent)

    vmcatcher event to handle

  • event_name (String)

    name of the event



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/itchy/event_handlers/expire_postfix_event_handler.rb', line 8

def handle!(vmcatcher_event, event_name)
  super
  Itchy::Log.info "[#{self.class.name}] Handling expired image " \
                         "for #{vmcatcher_event.dc_identifier.inspect}"
  begin
    save_descriptor(create_descriptor(vmcatcher_event), event_name)
  rescue Itchy::Errors::PrepareEnvError => ex
    Itchy::Log.error "[#{self.cass.name}] Problem with handling event #{event_name}" \
      "Event handling failed with #{ex.message}"
    fail Itchy::Errors::EventHandleError, ex
  end
end