openstudio-aws 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: 1b339787cd0967f1ab44992733179e27cfa05cfc
4
- data.tar.gz: a2f888edb0fd50d97a76476a7ced3e61ea04237a
3
+ metadata.gz: 4624c9a6d3d224d6f9027d2b9ad3656825425f9a
4
+ data.tar.gz: dd87ae4236d716745c7c9b7789734b576ba61925
5
5
  SHA512:
6
- metadata.gz: 17bad2a4a1199649a49a1dbd4d415a3e2a9a50c1cb77738abcef8bf0ad4e17871988e0ff95455657449a4d2e03b5303489ad4413b7a961de4c239dd3e55424e6
7
- data.tar.gz: 0d9d356fec2819cde276c2697b853e15784989c097a8953feda6ace4485c8342cf278f0c96dda96e9333b1276490aa73eecf878f0d033d8dadb8c7a21435b2ca
6
+ metadata.gz: c63b655b893617754e33982fe73841efb33819c5ccb49577ec27eae3b489e7b6ea35e22aa22bbb486c4e2b51dcce2aafa4c5a7931b979823de113902fc7188eb
7
+ data.tar.gz: 55a4d419a28279db424a213a2537f4472db04762fbeb399490e453b45a14e61fd398bcd114485e097a2ac00d7e2dfd833e73eb8e639ee400185bd403227cfdfd
@@ -1,6 +1,6 @@
1
1
  module OpenStudio
2
2
  module Aws
3
- VERSION = "0.1.5"
3
+ VERSION = "0.1.6"
4
4
  OPENSTUDIO_VERSION = "1.1.4"
5
5
  end
6
6
  end
@@ -45,8 +45,6 @@ require 'net/ssh'
45
45
  require 'tempfile'
46
46
  require 'time'
47
47
 
48
- OPENSTUDIO_VERSION='1.1.4'
49
-
50
48
  def error(code, msg)
51
49
  puts ({:error => {:code => code, :message => msg},
52
50
  :arguments => ARGV[2..-1]}.to_json)
@@ -90,21 +88,28 @@ end
90
88
 
91
89
  if ARGV.length == 6
92
90
  @params = JSON.parse(ARGV[5])
91
+ OPENSTUDIO_VERSION = @params['openstudio_version'] if @params.include?('openstudio_version')
92
+ @server_image_id = @params['server_ami'] if @params.include?('server_ami')
93
+ @worker_image_id = @params['worker_ami'] if @params.include?('worker_ami')
93
94
  end
94
95
 
95
- resp = Net::HTTP.get_response('developer.nrel.gov','/downloads/buildings/openstudio/rsrc/amis.json')
96
- if resp.code == '200'
97
- result = JSON.parse(resp.body)
98
- version = result.has_key?(OPENSTUDIO_VERSION) ? OPENSTUDIO_VERSION : 'default'
96
+ OPENSTUDIO_VERSION = '1.1.4' unless defined?(OPENSTUDIO_VERSION)
97
+
98
+ if (!defined?(@server_image_id) || !defined?(@worker_image_id))
99
+ resp = Net::HTTP.get_response('developer.nrel.gov','/downloads/buildings/openstudio/rsrc/amis.json')
100
+ if resp.code == '200'
101
+ result = JSON.parse(resp.body)
102
+ version = result.has_key?(OPENSTUDIO_VERSION) ? OPENSTUDIO_VERSION : 'default'
99
103
 
100
- @server_image_id = result[version]['server']
101
- if ARGV.length >= 6 && @params['instance_type'] == 'cc2.8xlarge'
102
- @worker_image_id = result[version]['cc2worker']
104
+ @server_image_id = result[version]['server']
105
+ if ARGV.length >= 6 && @params['instance_type'] == 'cc2.8xlarge'
106
+ @worker_image_id = result[version]['cc2worker']
107
+ else
108
+ @worker_image_id = result[version]['worker']
109
+ end
103
110
  else
104
- @worker_image_id = result[version]['worker']
111
+ error(resp.code, 'Unable to download AMI IDs')
105
112
  end
106
- else
107
- error(resp.code, 'Unable to download AMI IDs')
108
113
  end
109
114
 
110
115
  def create_struct(instance, procs)
@@ -345,7 +350,7 @@ def download_file(host, remote_path, local_path)
345
350
  end
346
351
 
347
352
  begin
348
- @logger = Logger.new("aws.log")
353
+ @logger = Logger.new(File.expand_path("~/.aws.log"))
349
354
  @logger.info("initialized")
350
355
  case ARGV[4]
351
356
  when 'describe_availability_zones'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstudio-aws
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
  - Nicholas Long
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: 1.26.0
33
+ version: 1.30.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: 1.26.0
40
+ version: 1.30.1
41
41
  description: Custom classes for configuring clusters for OpenStudio & EnergyPlus analyses
42
42
  email:
43
43
  - Nicholas.Long@nrel.gov