stem 0.4.7 → 0.4.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/stem/image.rb +13 -1
  2. metadata +3 -3
data/lib/stem/image.rb CHANGED
@@ -6,7 +6,19 @@ module Stem
6
6
  def create name, instance, tags
7
7
  raise "You already have an image named '#{name}'" if named(name)
8
8
  image_id = swirl.call("CreateImage", "Name" => name, "InstanceId" => instance)["imageId"]
9
- Tag::create(image_id, tags) unless tags.empty?
9
+ unless tags.empty?
10
+ # We'll retry this once if necessary due to consistency issues on the AWS side
11
+ i = 0
12
+ begin
13
+ Tag::create(image_id, tags)
14
+ rescue Swirl::InvalidRequest => e
15
+ if i < 1 && e.message =~ /does not exist/
16
+ i += 1
17
+ retry
18
+ end
19
+ raise e
20
+ end
21
+ end
10
22
  image_id
11
23
  end
12
24
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stem
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 7
10
- version: 0.4.7
9
+ - 8
10
+ version: 0.4.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Peter van Hardenberg