stemcell 0.11.7 → 0.11.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/stemcell/launcher.rb +14 -11
- data/lib/stemcell/version.rb +1 -1
- data/spec/lib/stemcell/launcher_spec.rb +11 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aac5c43057f6dedabdbae868bc6d2ba532a024f2
|
4
|
+
data.tar.gz: c0dfd5f07899e1b6ead8c9ba6c201aebee2177dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33f543e985945155f3f08618b8d3922827c0351bbf1733e76a6384086bae081539d73eb36e5fc8c73febc47f5d6a2bd8397f288edcfe248f7366e9d36d428e91
|
7
|
+
data.tar.gz: b15dc55412394a25fbb989fb12c7a3f8f2da632891755e312825e58a37ac889f1d0896a39f4fff747c92f7a90f9e34c1db43757ef2591a226ffd7de8e926b12f
|
data/CHANGELOG.md
CHANGED
data/lib/stemcell/launcher.rb
CHANGED
@@ -78,6 +78,7 @@ module Stemcell
|
|
78
78
|
@aws_access_key = opts['aws_access_key']
|
79
79
|
@aws_secret_key = opts['aws_secret_key']
|
80
80
|
@aws_session_token = opts['aws_session_token']
|
81
|
+
configure_aws_creds_and_region
|
81
82
|
end
|
82
83
|
|
83
84
|
def launch(opts={})
|
@@ -429,17 +430,6 @@ module Stemcell
|
|
429
430
|
def ec2
|
430
431
|
return @ec2 if @ec2
|
431
432
|
|
432
|
-
# configure AWS with creds/region
|
433
|
-
aws_configs = {:region => @region}
|
434
|
-
aws_configs.merge!({
|
435
|
-
:access_key_id => @aws_access_key,
|
436
|
-
:secret_access_key => @aws_secret_key
|
437
|
-
}) if @aws_access_key && @aws_secret_key
|
438
|
-
aws_configs.merge!({
|
439
|
-
:session_token => @aws_session_token,
|
440
|
-
}) if @aws_session_token
|
441
|
-
AWS.config(aws_configs)
|
442
|
-
|
443
433
|
# calculate our ec2 url
|
444
434
|
ec2_url = "ec2.#{@region}.amazonaws.com"
|
445
435
|
|
@@ -460,5 +450,18 @@ module Stemcell
|
|
460
450
|
sleep [RUNNING_STATE_WAIT_SLEEP_TIME, times_out_at - now].min
|
461
451
|
end
|
462
452
|
end
|
453
|
+
|
454
|
+
def configure_aws_creds_and_region
|
455
|
+
# configure AWS with creds/region
|
456
|
+
aws_configs = {:region => @region}
|
457
|
+
aws_configs.merge!({
|
458
|
+
:access_key_id => @aws_access_key,
|
459
|
+
:secret_access_key => @aws_secret_key
|
460
|
+
}) if @aws_access_key && @aws_secret_key
|
461
|
+
aws_configs.merge!({
|
462
|
+
:session_token => @aws_session_token,
|
463
|
+
}) if @aws_session_token
|
464
|
+
AWS.config(aws_configs)
|
465
|
+
end
|
463
466
|
end
|
464
467
|
end
|
data/lib/stemcell/version.rb
CHANGED
@@ -156,4 +156,15 @@ describe Stemcell::Launcher do
|
|
156
156
|
expect(errors.all?(&:nil?)).to be true
|
157
157
|
end
|
158
158
|
end
|
159
|
+
|
160
|
+
describe '#configure_aws_creds_and_region' do
|
161
|
+
it 'AWS region is configured after launcher is instanciated' do
|
162
|
+
expect(AWS.config.region).to be_eql('region')
|
163
|
+
end
|
164
|
+
|
165
|
+
it 'AWS region configuration changed' do
|
166
|
+
mock_launcher = Stemcell::Launcher.new('region' => 'ap-northeast-1')
|
167
|
+
expect(AWS.config.region).to be_eql('ap-northeast-1')
|
168
|
+
end
|
169
|
+
end
|
159
170
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stemcell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Rhoads
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2018-01-02 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: aws-sdk-v1
|
@@ -239,7 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
239
239
|
version: '0'
|
240
240
|
requirements: []
|
241
241
|
rubyforge_project:
|
242
|
-
rubygems_version: 2.5.
|
242
|
+
rubygems_version: 2.4.5.1
|
243
243
|
signing_key:
|
244
244
|
specification_version: 4
|
245
245
|
summary: no summary
|