Skip to content

Commit

Permalink
removed whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
tzumainn committed Oct 23, 2017
1 parent c362a8f commit 268c221
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ def self.event_to_hash(event, ems_id)
content = message_content(event, ems_id)
event_type = content["event_type"]
payload = content["payload"]

log_header = "ems_id: [#{ems_id}] " unless ems_id.nil?
_log.debug("#{log_header}event: [#{event_type}]") if $log && $log.debug?

# attributes that are common to all notifications
event_hash = {
:event_type => event_type,
Expand All @@ -17,14 +17,14 @@ def self.event_to_hash(event, ems_id)
:full_data => event,
:ems_id => ems_id
}

event_hash[:vm_ems_ref] = payload["instance_id"] if payload.key? "instance_id"
event_hash[:host_ems_ref] = payload["host"] if payload.key? "host"
event_hash[:availability_zone_ems_ref] = payload["availability_zone"] if payload.key? "availability_zone"
event_hash[:chain_id] = payload["reservation_id"] if payload.key? "reservation_id"
event_hash
end

def self.message_content(event, ems_id)
unless ems_id.nil?
ems = ExtManagementSystem.find_by_id(ems_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ def self.event_to_hash(event, ems_id)
content = message_content(event, ems_id)
event_type = content["event_type"]
payload = content["payload"]

log_header = "ems_id: [#{ems_id}] " unless ems_id.nil?
_log.debug("#{log_header}event: [#{event_type}]") if $log && $log.debug?

# attributes that are common to all notifications
event_hash = {
:event_type => event_type,
Expand All @@ -17,14 +17,14 @@ def self.event_to_hash(event, ems_id)
:full_data => event,
:ems_id => ems_id
}

event_hash[:vm_ems_ref] = payload["instance_id"] if payload.key? "instance_id"
event_hash[:host_ems_ref] = payload["host"] if payload.key? "host"
event_hash[:availability_zone_ems_ref] = payload["availability_zone"] if payload.key? "availability_zone"
event_hash[:chain_id] = payload["reservation_id"] if payload.key? "reservation_id"
event_hash
end

def self.message_content(event, ems_id)
unless ems_id.nil?
ems = ExtManagementSystem.find_by_id(ems_id)
Expand Down

0 comments on commit 268c221

Please sign in to comment.