Skip to content

Commit

Permalink
Set sub_event_type for com.vmware.cns.tasks.updatevolume
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Sep 20, 2023
1 parent 3bdb9cd commit ffd7fa1
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ def self.event_to_hash(event, ems_id = nil)
case sub_event_type
when nil
# Handle cases where event name is missing
sub_event_type = 'PowerOnVM_Task' if event['fullFormattedMessage'].to_s.downcase == 'task: power on virtual machine'
sub_event_type = 'DrsMigrateVM_Task' if sub_event_type.nil? && event.fetch_path('info', 'descriptionId') == 'Drm.ExecuteVMotionLRO'
sub_event_type = 'PowerOnVM_Task' if event['fullFormattedMessage'].to_s.downcase == 'task: power on virtual machine'
sub_event_type = 'DrsMigrateVM_Task' if sub_event_type.nil? && event.fetch_path('info', 'descriptionId') == 'Drm.ExecuteVMotionLRO'
sub_event_type = 'CnsUpdateVolume_Task' if sub_event_type.nil? && event.fetch_path('info', 'descriptionId') == 'com.vmware.cns.tasks.updatevolume'

if sub_event_type.nil?
_log.warn("#{log_header}Event Type cannot be determined for TaskEvent. Using generic eventType [TaskEvent] instead. event: [#{event.inspect}]")
sub_event_type = 'TaskEvent'
Expand Down

0 comments on commit ffd7fa1

Please sign in to comment.