Skip to content

Commit

Permalink
Merge pull request #128 from petrblaho/add-vm-snapshot-success-notifi…
Browse files Browse the repository at this point in the history
…cation

Adds vm_snapshot_success Notification creation
  • Loading branch information
aufi authored Oct 25, 2017
2 parents 3692df0 + 66be7bd commit e050a37
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/manageiq/providers/openstack/cloud_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ def vm_create_snapshot(vm, options = {})

miq_openstack_instance = MiqOpenStackInstance.new(vm.ems_ref, openstack_handle)
snapshot = miq_openstack_instance.create_snapshot(options)
Notification.create(:type => :vm_snapshot_success, :subject => vm, :options => {:snapshot_op => 'create'})
snapshot_id = snapshot["id"]

# Add new snapshot to the snapshots table.
Expand All @@ -265,6 +266,7 @@ def vm_remove_snapshot(vm, options = {})

miq_openstack_instance = MiqOpenStackInstance.new(vm.ems_ref, openstack_handle)
miq_openstack_instance.delete_evm_snapshot(snapshot_uid)
Notification.create(:type => :vm_snapshot_success, :subject => vm, :options => {:snapshot_op => 'remove'})

# Remove from the snapshots table.
ar_snapshot = vm.snapshots.find_by(:ems_ref => snapshot_uid)
Expand Down

0 comments on commit e050a37

Please sign in to comment.