Skip to content

Commit

Permalink
Add a 'name' parameter to backup restore, and make vol_id optional
Browse files Browse the repository at this point in the history
Supports Openstack feature that allows restoring backups to
newly created volumes.
  • Loading branch information
mansam committed Sep 6, 2018
1 parent bb7d748 commit 4a7ee42
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/models/cloud_volume_backup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CloudVolumeBackup < ApplicationRecord
belongs_to :cloud_volume
has_one :cloud_tenant, :through => :cloud_volume

def restore_queue(userid, volumeid)
def restore_queue(userid, volumeid = nil, name = nil)
task_opts = {
:action => "Restoring Cloud Volume Backup for user #{userid}",
:userid => userid
Expand All @@ -22,13 +22,13 @@ def restore_queue(userid, volumeid)
:instance_id => id,
:role => 'ems_operations',
:zone => ext_management_system.my_zone,
:args => [volumeid]
:args => [volumeid, name]
}
MiqTask.generic_action_with_callback(task_opts, queue_opts)
end

def restore(volume)
raw_restore(volume)
def restore(volume = nil, name = nil)
raw_restore(volume, name)
end

def raw_restore(*)
Expand Down

0 comments on commit 4a7ee42

Please sign in to comment.