Skip to content

Commit

Permalink
Enhance logging around remove snapshot operations
Browse files Browse the repository at this point in the history
Prior to removing a snapshot log the id, uid_ems, ems_ref, name, and
description to aid in diagnosing errors.

https://bugzilla.redhat.com/show_bug.cgi?id=1549299
  • Loading branch information
agrare committed Feb 27, 2018
1 parent 2b45079 commit a475155
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/vm_or_template/operations/snapshot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def raw_remove_snapshot(snapshot_id)
snapshot = snapshots.find_by(:id => snapshot_id)
raise _("Requested VM snapshot not found, unable to remove snapshot") unless snapshot
begin
_log.info("removing snapshot ID: [#{snapshot.id}] uid_ems: [#{snapshot.uid_ems}] ems_ref: [#{snapshot.ems_ref}] name: [#{snapshot.name}] description [#{snapshot.description}]")

run_command_via_parent(:vm_remove_snapshot, :snMor => snapshot.uid_ems)
rescue => err
create_notification(:vm_snapshot_failure, :error => err.to_s, :snapshot_op => "remove")
Expand Down

0 comments on commit a475155

Please sign in to comment.