ebs-snapshoter 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/snapshoter/manager.rb +0 -1
- data/lib/snapshoter/provider/ec2.rb +8 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
data/lib/snapshoter/manager.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'right_aws'
|
2
|
+
require 'time'
|
2
3
|
|
3
4
|
module Snapshoter
|
4
5
|
module Provider
|
@@ -10,7 +11,13 @@ module Snapshoter
|
|
10
11
|
# Returns the most recent time a snapshot was started for a given volume or nil if there are none
|
11
12
|
def last_snapshot_at(volume)
|
12
13
|
snapshots = snapshots_by_volume_id(volume.id)
|
13
|
-
snapshots.any?
|
14
|
+
if snapshots.any?
|
15
|
+
time = snapshots.first[:aws_started_at]
|
16
|
+
# Account for right_aws API differences
|
17
|
+
String === time ? Time.parse(time) : time
|
18
|
+
else
|
19
|
+
nil
|
20
|
+
end
|
14
21
|
end
|
15
22
|
|
16
23
|
def snapshot_volume(volume)
|