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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e47184d3770ccf05149c40f7c5c5ba4dd15bf41
4
- data.tar.gz: 8955170fb745c11c2d475a1e03c58d4abd025d5a
3
+ metadata.gz: e76a98d90f4b840f3ea01b178317d30e88dca806
4
+ data.tar.gz: 637316bd93c36171d55ec98321cc81f2a96f9d3e
5
5
  SHA512:
6
- metadata.gz: 1a4128672aabf8c0b7d3752578cf08ce02c8b59e60dcd5a42ebb87b39665534fc80a3b14613faa6e8bf6bcec41ac82172c0ef38fd1090381a30eb54cda17d90e
7
- data.tar.gz: 1f5391fa2e63a501d224c9a7126f4417691635cbc22342a5cca7d6a7396acec27c9a10c01618253c7d879165a21230449823ad48e4a6f7258a8d901701d20e2c
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
- destination_snapshots = @destination_ec2.snapshots(owner_ids: [@config.owner_id], filters: [{name: "tag:#{SOURCE_SNAPSHOT_ID_TAG_KEY}", values: source_snapshot_ids}])
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
- source_snapshots = @source_ec2.snapshots(owner_ids: [@config.owner_id], filters: [{name: 'snapshot-id', values: source_snapshot_ids}])
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
@@ -1,7 +1,7 @@
1
1
  module EC2
2
2
  module Snapshot
3
3
  module Replicator
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.6"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ec2-snapshot-replicator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai