openstudio-aws 0.5.0.rc1 → 0.5.0.rc2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 08ed2838c540e0945bf7f3e5d43acecad8ec5d59
4
- data.tar.gz: 40b2b50ee9ed04c29c30b56ee45e2268947d0891
3
+ metadata.gz: 8e388aa0be78ded9805099223d0d4b448b1a6830
4
+ data.tar.gz: 591b32d3e619a3772c972afd6f1bcd04c999d7bb
5
5
  SHA512:
6
- metadata.gz: d0bd7fe21356210a0b765dd010169fdcb8acdd6024e0887191078f122f0cd8d6f955d3d64cdfa05cbd59480335e75ad5481806e85b6aadb66e6c1ad8fb269a8a
7
- data.tar.gz: 23fae6dd410cd52926e1574cdba13bda5def8c7c593623e32ccd698eba0f6741065f527d6e057d5169e303e0475ae8f0b973578db040f075d08dbc4d2a6e1f65
6
+ metadata.gz: a2f9a92a9a26f0f4ebdc380e8ab16154c7fadadbad159312894e84d370419d659a91805f9cb51d717ecc69e32c641e036192c833420b2e178e7193c749bdb7e6
7
+ data.tar.gz: 336f34740bdc97c15047d0d43d5629fcc7b63395a18aa0bd6be67d380f0e0bf0278c964fa6f33d8c4b7a85b3716ce0639920b8e8fa966ed4360007c16520d33e
@@ -1,5 +1,5 @@
1
1
  module OpenStudio
2
2
  module Aws
3
- VERSION = '0.5.0.rc1'
3
+ VERSION = '0.5.0.rc2'
4
4
  end
5
5
  end
@@ -179,20 +179,24 @@ class OpenStudioAmis
179
179
  # Return the required docker AMI base box
180
180
  def get_ami_version_3
181
181
  json = list
182
- amis = {}
182
+ amis = nil
183
183
  if @options[:openstudio_version].to_sym == :default && @options[:openstudio_server_version].to_sym == :default
184
184
  # grab the most recent openstudio server version - this is not recommended
185
- key, value = json[:openstudio_server].first
185
+ key, value = json[:builds].first
186
+ amis = {}
186
187
  amis[:server] = value[:ami]
187
188
  amis[:worker] = value[:ami]
188
189
  elsif @options[:openstudio_server_version] != 'default'
189
- value = json[:openstudio_server][@options[:openstudio_server_version].to_sym]
190
- amis[:server] = value[:ami]
191
- amis[:worker] = value[:ami]
190
+ hash_array = json[:builds]
191
+ hash = hash_array.select { |hash| hash[:name] == @options[:openstudio_server_version] }
192
+ fail "Multiple | no entries found matching name key `#{@options[:openstudio_server_version]}`" unless hash.length == 1
193
+ amis = {}
194
+ amis[:server] = hash.first[:ami]
195
+ amis[:worker] = hash.first[:ami]
192
196
  elsif @options[:openstudio_version] != 'default'
193
197
  fail 'Currently the openstudio_version lookup is not supported in v3.'
194
198
  end
195
-
199
+ fail 'The requested AMI key is NULL.' if amis[:server] == nil
196
200
  logger.info "AMI IDs are #{amis}" if amis
197
201
 
198
202
  amis
@@ -14,12 +14,11 @@ describe OpenStudioAmis do
14
14
  end
15
15
 
16
16
  it 'should return specific amis if passed a version' do
17
- a = OpenStudioAmis.new(1, openstudio_version: '1.2.1')
17
+ a = OpenStudioAmis.new(1, openstudio_version: '1.13.2')
18
18
  amis = a.get_amis
19
19
 
20
- expect(amis[:server]).to eq('ami-89744be0')
21
- expect(amis[:worker]).to eq('ami-37744b5e')
22
- expect(amis[:cc2worker]).to eq('ami-51744b38')
20
+ expect(amis[:server]).to eq('ami-e7a1bbf0')
21
+ expect(amis[:worker]).to eq('ami-e0a1bbf7')
23
22
  end
24
23
 
25
24
  it 'should list all amis' do
@@ -30,14 +29,14 @@ describe OpenStudioAmis do
30
29
  end
31
30
 
32
31
  context 'version 2' do
33
- it 'should return openstudio server version 1.8.0 correctly' do
34
- a = OpenStudioAmis.new(2, openstudio_server_version: '1.8.0')
32
+ it 'should return openstudio server version 1.21.14 correctly' do
33
+ a = OpenStudioAmis.new(2, openstudio_server_version: '1.21.14')
35
34
 
36
35
  amis = a.get_amis
37
36
 
38
- expect(amis[:server]).to eq('ami-3c0fbf54')
39
- expect(amis[:worker]).to eq('ami-040ebe6c')
40
- expect(amis[:cc2worker]).to eq('ami-040ebe6c')
37
+ expect(amis[:server]).to eq('ami-43a74255')
38
+ expect(amis[:worker]).to eq('ami-24a04532')
39
+ expect(amis[:cc2worker]).to eq(nil)
41
40
  end
42
41
  end
43
42
 
@@ -25,17 +25,6 @@ describe OpenStudio::Aws::Aws do
25
25
 
26
26
  expect(aws.default_amis).not_to be_nil
27
27
  end
28
-
29
- it 'should find the cc2 instances' do
30
- options = {
31
- ami_lookup_version: 2,
32
- openstudio_server_version: '1.5.0'
33
- }
34
- aws = OpenStudio::Aws::Aws.new(options)
35
-
36
- expect(aws.determine_image_type('cc2.2xlarge')).to eq 'ami-e582948c'
37
- expect(aws.determine_image_type('c3.2xlarge')).to eq 'ami-918294f8'
38
- end
39
28
  end
40
29
 
41
30
  context 'should error' do
@@ -49,14 +38,14 @@ describe OpenStudio::Aws::Aws do
49
38
  end
50
39
 
51
40
  context 'version testing' do
52
- it 'version 2: should find the right AMIs Server 1.3.1' do
41
+ it 'version 2: should find the right AMIs Server 1.21.15' do
53
42
  options = {
54
43
  ami_lookup_version: 2,
55
- openstudio_server_version: '1.3.1'
44
+ openstudio_server_version: '1.21.15'
56
45
  }
57
46
  aws = OpenStudio::Aws::Aws.new(options)
58
- expect(aws.default_amis[:worker]).to eq('ami-39bb8750')
59
- expect(aws.default_amis[:server]).to eq('ami-a9bb87c0')
47
+ expect(aws.default_amis[:worker]).to eq('ami-ccb35ada')
48
+ expect(aws.default_amis[:server]).to eq('ami-54b45d42')
60
49
  end
61
50
  end
62
51
 
@@ -73,9 +73,9 @@ describe OpenStudioAwsWrapper do
73
73
  context 'version 2' do
74
74
  it 'should create a new json' do
75
75
  resp = @aws.os_aws.create_new_ami_json(2)
76
- expect(resp[:openstudio_server]['1.8.0'.to_sym][:amis][:server]).to eq('ami-3c0fbf54')
77
- expect(resp[:openstudio_server]['1.3.1'.to_sym][:openstudio_version_sha]).to eq('7a955d780b')
78
- expect(resp[:openstudio_server]['1.3.5'.to_sym][:tested]).to eq(false)
76
+ expect(resp[:openstudio_server]['1.21.4'.to_sym][:amis][:server]).to eq('ami-e7a1bbf0')
77
+ expect(resp[:openstudio_server]['1.21.4'.to_sym][:openstudio_version_sha]).to eq('6103d54380')
78
+ expect(resp[:openstudio_server]['1.21.4'.to_sym][:tested]).to eq(false)
79
79
  end
80
80
  end
81
81
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstudio-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0.rc1
4
+ version: 0.5.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Long
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-08 00:00:00.000000000 Z
11
+ date: 2017-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-scp