ec2-rotate-volume-snapshots 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.0
1
+ 0.7.0
@@ -73,7 +73,7 @@ def rotate_em(snapshots)
73
73
  else
74
74
  puts " #{time.strftime '%Y-%m-%d %H:%M:%S'} #{snapshot_id} Deleting"
75
75
  begin
76
- ec2.delete_snapshot(snapshot_id) unless $opts[:dry_run]
76
+ $ec2.delete_snapshot(snapshot_id) unless $opts[:dry_run]
77
77
  rescue RightAws::AwsError => e
78
78
  # If we have been sending too many EC2 requests, then let's backoff a random
79
79
  # amount of time and try again later.
@@ -186,7 +186,7 @@ end
186
186
 
187
187
  $backoffed = 0
188
188
  begin
189
- ec2 = RightAws::Ec2.new($opts[:aws_access_key], $opts[:aws_secret_access_key], :region => $opts[:aws_region])
189
+ $ec2 = RightAws::Ec2.new($opts[:aws_access_key], $opts[:aws_secret_access_key], :region => $opts[:aws_region])
190
190
  rescue RightAws::AwsError => e
191
191
  # If we have been sending too many EC2 requests, then let's backoff a random
192
192
  # amount of time and try again later.
@@ -207,7 +207,7 @@ all_snapshots = []
207
207
  if $opts[:by_tags]
208
208
  $opts[:by_tags].each do |tag, value|
209
209
  begin
210
- these_snapshots = ec2.describe_tags(:filters => {'resource-type'=>"snapshot", 'key'=>tag, 'value'=>value}).map {|t| t[:resource_id]}
210
+ these_snapshots = $ec2.describe_tags(:filters => {'resource-type'=>"snapshot", 'key'=>tag, 'value'=>value}).map {|t| t[:resource_id]}
211
211
  rescue RightAws::AwsError => e
212
212
  # If we have been sending too many EC2 requests, then let's backoff a random
213
213
  # amount of time and try again later.
@@ -239,7 +239,7 @@ if $opts[:by_tags]
239
239
  end
240
240
 
241
241
  begin
242
- rotate_these = ec2.describe_snapshots(all_snapshots).sort {|a,b| a[:aws_started_at] <=> b[:aws_started_at] }
242
+ rotate_these = $ec2.describe_snapshots(all_snapshots).sort {|a,b| a[:aws_started_at] <=> b[:aws_started_at] }
243
243
  rescue RightAws::AwsError => e
244
244
  # If we have been sending too many EC2 requests, then let's backoff a random
245
245
  # amount of time and try again later.
@@ -258,7 +258,7 @@ if $opts[:by_tags]
258
258
  rotate_em(rotate_these)
259
259
  else
260
260
  begin
261
- all_snapshots = ec2.describe_snapshots(:filters => { 'volume-id' => volume_ids })
261
+ all_snapshots = $ec2.describe_snapshots(:filters => { 'volume-id' => volume_ids })
262
262
  rescue RightAws::AwsError => e
263
263
  # If we have been sending too many EC2 requests, then let's backoff a random
264
264
  # amount of time and try again later.
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ec2-rotate-volume-snapshots}
8
- s.version = "0.6.0"
8
+ s.version = "0.7.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Zach Wily"]
12
- s.date = %q{2012-10-30}
12
+ s.date = %q{2012-10-31}
13
13
  s.default_executable = %q{ec2-rotate-volume-snapshots}
14
14
  s.description = %q{Provides a simple way to rotate EC2 snapshots with configurable retention periods.}
15
15
  s.email = %q{zach@zwily.com}
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ec2-rotate-volume-snapshots
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 6
8
+ - 7
9
9
  - 0
10
- version: 0.6.0
10
+ version: 0.7.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Zach Wily
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-10-30 00:00:00 -06:00
18
+ date: 2012-10-31 00:00:00 -06:00
19
19
  default_executable: ec2-rotate-volume-snapshots
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency