ec2-snapshot-replicator 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ec2/snapshot/replicator/engine.rb +12 -2
- data/lib/ec2/snapshot/replicator/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e76a98d90f4b840f3ea01b178317d30e88dca806
|
4
|
+
data.tar.gz: 637316bd93c36171d55ec98321cc81f2a96f9d3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bef10b15631a907db01cea47c1f28ead086a65f2d9ec6a599959ca86e88a8046e50ddb660856026d3acdf27707f674a3143c8995747d96d0530f6b35662ea983
|
7
|
+
data.tar.gz: 4545809da58599e4374e2f16291ac44329a646bdc751f39330d79670ff2d266ffff38c3fed7a2b5b2e377c427eabc40f81691e09412674c9e2579d535bd2b25d
|
@@ -40,7 +40,14 @@ module EC2
|
|
40
40
|
source_snapshots = @source_ec2.snapshots(owner_ids: [@config.owner_id])
|
41
41
|
source_snapshot_ids = source_snapshots.map {|s| s.id }
|
42
42
|
|
43
|
-
|
43
|
+
# The maximum number of filter values specified on a single call is 200
|
44
|
+
destination_snapshots = source_snapshot_ids.each_slice(190).flat_map do |ids|
|
45
|
+
@destination_ec2.snapshots(
|
46
|
+
owner_ids: [@config.owner_id],
|
47
|
+
filters: [{name: "tag:#{SOURCE_SNAPSHOT_ID_TAG_KEY}", values: ids}]
|
48
|
+
).to_a
|
49
|
+
end
|
50
|
+
|
44
51
|
source_snapshots.each do |snapshot|
|
45
52
|
destination_snapshot = destination_snapshots.find do |s|
|
46
53
|
s.tags.find do |t|
|
@@ -93,7 +100,10 @@ module EC2
|
|
93
100
|
snapshot.tags.find {|t| t.key == SOURCE_SNAPSHOT_ID_TAG_KEY }.value
|
94
101
|
end
|
95
102
|
|
96
|
-
|
103
|
+
# The maximum number of filter values specified on a single call is 200
|
104
|
+
source_snapshots = source_snapshot_ids.each_slice(190).flat_map do |ids|
|
105
|
+
@source_ec2.snapshots(owner_ids: [@config.owner_id], filters: [{name: 'snapshot-id', values: ids}]).to_a
|
106
|
+
end
|
97
107
|
|
98
108
|
destination_snapshots.each do |snapshot|
|
99
109
|
source_snapshot_id = snapshot.tags.find {|t| t.key == SOURCE_SNAPSHOT_ID_TAG_KEY }.value
|