Skip to content

Commit

Permalink
Add event_id to the event parser and change the query for refresh eve…
Browse files Browse the repository at this point in the history
…nts to use this attribute
  • Loading branch information
AndreyMenezes committed Sep 21, 2017
1 parent f109fdd commit f5ad52a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ def create_event_monitor_handle(ems)
end

def get_last_cnn_from_events(ems_id)
EventStream.where(:ems_id => ems_id).select(:full_data).map { |event| event.full_data["cn"].to_i }.max || 1
EventStream.where(:ems_id => ems_id).maximum('event_id') || 1
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module ManageIQ::Providers::Lenovo::PhysicalInfraManager::EventParser
def self.event_to_hash(event, ems_id)
event_hash = {
:event_type => event.eventID,
:event_id => event.cn,
:source => "LenovoXclarity",
:physical_server_id => get_physical_server_id(event.componentID),
:message => event.msg,
Expand Down

0 comments on commit f5ad52a

Please sign in to comment.