Skip to content

Commit

Permalink
use the cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
Garett Shulman committed Apr 30, 2014
1 parent 0c03c0c commit 652aa1b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/drebs/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def prune_backups(strategies)
to_prune = potential_prunes.uniq.select do |prune|
prune if @db['strategies'].find(:snapshots.like("%#{prune}%")) == 0
end
to_prune.each { |snapshot_to_prune| ec2.delete_snapshot(snapshot_to_prune.split(":")[0]) }
to_prune.each { |snapshot_to_prune| @cloud.ec2.delete_snapshot(snapshot_to_prune.split(":")[0]) }
end

def execute
Expand All @@ -133,11 +133,11 @@ def execute

@log.info("creating snapshot of #{mount_point}")
begin
snapshot = create_local_snapshot(pre_snapshot_tasks, post_snapshot_tasks, mount_point)
snapshot = @cloud.create_local_snapshot(pre_snapshot_tasks, post_snapshot_tasks, mount_point)

strategies.collect {|s|
snapshots = s[:snapshots].split(",")
snapshots.select!{|snapshot| local_ebs_ids.include? snapshot.split(":")[1]}
snapshots.select!{|snapshot| @cloud.local_ebs_ids.include? snapshot.split(":")[1]}
snapshots.push(
s[:status]=='active' ?
"#{snapshot[:aws_id]}:#{snapshot[:aws_volume_id]}" : nil
Expand All @@ -150,7 +150,7 @@ def execute

rescue Exception => error
@log.error("Exception occured during backup: #{error.message}\n#{error.backtrace.join("\n")}")
send_email("DREBS Error!", "AWS Instance: #{find_local_instance[:aws_instance_id]}\n#{error.message}\n#{error.backtrace.join("\n")}")
send_email("DREBS Error!", "AWS Instance: #{@cloud.find_local_instance[:aws_instance_id]}\n#{error.message}\n#{error.backtrace.join("\n")}")
end
end

Expand Down

0 comments on commit 652aa1b

Please sign in to comment.