When dbomatic logs new events, it makes more sense
to update the event types as internal aggregator events
(started, stopped, etc), rather than the generic
condor "JobAdInformationEvent".

Signed-off-by: Chris Lalancette <[email protected]>
---
 src/dbomatic/dbomatic |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/dbomatic/dbomatic b/src/dbomatic/dbomatic
index a30889c..634d0a0 100755
--- a/src/dbomatic/dbomatic
+++ b/src/dbomatic/dbomatic
@@ -89,13 +89,7 @@ class CondorEventLog < Nokogiri::XML::SAX::Document
     end
   end
 
-  def update_instance_event(inst)
-    InstanceEvent.create! :instance => inst,
-                          :event_type => @event_type,
-                          :event_time => @event_time
-  end
-
-  def update_instance_state(inst)
+  def update_instance_state_event(inst)
     if @trigger_type == "ULOG_GRID_SUBMIT"
       inst.state = Instance::STATE_PENDING
     elsif @trigger_type == "ULOG_JOB_ABORTED" or @trigger_Type == 
"ULOG_JOB_TERMINATED"
@@ -111,6 +105,10 @@ class CondorEventLog < Nokogiri::XML::SAX::Document
       return
     end
     inst.save!
+
+    InstanceEvent.create! :instance => inst,
+                          :event_type => inst.state,
+                          :event_time => @event_time
   end
 
   def update_instance_cloud_id(inst)
@@ -160,8 +158,7 @@ class CondorEventLog < Nokogiri::XML::SAX::Document
       if inst.nil?
         puts "Unexpected nil instance, skipping..."
       else
-        update_instance_event(inst)
-        update_instance_state(inst)
+        update_instance_state_event(inst)
         update_instance_cloud_id(inst)
       end
       @tag = @event_type = @event_cmd = @event_time = @trigger_type = 
@grid_resource = @execute_host = nil
-- 
1.7.2.3

_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to