amazon-pricing 0.1.72 → 0.1.73

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NGY4MTgzNzUyZDMyYmZjYjViNDU4MGRjMWIwNzVkOTVmMjlmNjMwYQ==
4
+ YzhlODhkYmE1OGQ1MmU5ZmJiNDMwMTdmNGY0NTRiMmQ0OTY5NDY5Mw==
5
5
  data.tar.gz: !binary |-
6
- MDhkNjQxZGEyZTkzMWIwNDU0ZTU1ZjdlZTBlYzAwYzE1ZmQ0NTMxZg==
6
+ NjA5NGE1MjgwOGIwZjVjNTA4YzA4NWQ0N2JiZTY3OTFjMTQxZWFkYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MWUxOWUyOGYzMzY5YzIyZmE4NWIwZTRkYzdmZjI3MTI1ZWU5ZGMzYTljNmQx
10
- MzY5ZDVkODkwNjJhYmViZTBmZGU4MTY0MjFkZWNjNTdhYjlhMGJkOTNmODIx
11
- OWVkZTcxOWU3ODlkN2Q4ODQyOGM3YzFiYmQ2ZTFiZmUyMWFlNzk=
9
+ ODczMjkyN2RjMzc1NzI3ZTQ4MDliOGE2NWEzZDVkYWZhMTJiZTFiMDZiNjg1
10
+ MTM5YTVhMDRlZmMwMzc4MWUyYzA4MjZkODBhODlkY2I4YWMyMWMzMjcwMzhl
11
+ MmQzNTI1NjBlY2YzZDdkYjQ3YmRkNThjY2RiMjkzYTE3ZjM3YjA=
12
12
  data.tar.gz: !binary |-
13
- MGQ4YWE4NWY4YmI0NWIyYWVjMWFlMTQ5NTgzMGNmZmU1NzgxYTEyODdlYmJm
14
- ZjI2ZTEzYzMwZWM0Y2U0Y2I1MDc4ZjRjZWZmNzM1NGI0ZDNlMThmNDdjYTIw
15
- OGE5ZTQwNmExMmJlZTY1NzcxOGQ3NjFhNjlmZDU1MmJhM2Q3MDU=
13
+ MjczMThkZWM0ZWU1ZjY3YjhjY2E3OWNlM2M1NmUyZmVmMjBiOWU0NWZmYTJh
14
+ NjQwZGY4ZTUxMTViNTZjMTllN2M5ZWYzZTI0MjIwYzgzZThlNTNkZjI0Nzhh
15
+ OGRjZGQ1MDRlNThkOTJjMDc5YmQ5ODhmZDZhZGE1YzQzNWEzOTQ=
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- amazon-pricing (0.1.72)
4
+ amazon-pricing (0.1.73)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -61,7 +61,12 @@ module AwsPricing
61
61
  def fetch_ec2_ebs_pricing
62
62
  res = PriceList.fetch_url(EBS_BASE_URL + "pricing-ebs.min.js")
63
63
  res["config"]["regions"].each do |ebs_types|
64
- region = get_region(ebs_types["region"])
64
+ region_name = ebs_types["region"]
65
+ region = get_region(region_name)
66
+ if region.nil?
67
+ $stderr.puts "[fetch_ec2_ebs_pricing] WARNING: unable to find region #{region_name}"
68
+ next
69
+ end
65
70
  region.ebs_price = EbsPrice.new(region)
66
71
  region.ebs_price.update_from_json(ebs_types)
67
72
  end
@@ -215,6 +215,10 @@ module AwsPricing
215
215
  res['config']['regions'].each do |reg|
216
216
  region_name = reg['region']
217
217
  region = get_region(region_name)
218
+ if region.nil?
219
+ $stderr.puts "[fetch_on_demand_rds_instance_pricing] WARNING: unable to find region #{region_name}"
220
+ next
221
+ end
218
222
  reg['types'].each do |type|
219
223
  type['tiers'].each do |tier|
220
224
  begin
@@ -8,5 +8,5 @@
8
8
  # Home:: http://github.com/CloudHealth/amazon-pricing
9
9
  #++
10
10
  module AwsPricing
11
- VERSION = '0.1.72'
11
+ VERSION = '0.1.73'
12
12
  end
@@ -177,18 +177,15 @@ class TestEc2InstanceTypes < Test::Unit::TestCase
177
177
  region = @@ec2_pricing.get_region('us-gov-west-1')
178
178
  instance = region.get_ec2_instance_type('r3.large')
179
179
  os = instance.get_operating_system(:linux)
180
- assert os.ondemand_price_per_hour == 0.210
181
- assert os.partialupfront_prepay_1_year == 649
182
- assert os.allupfront_prepay_1_year == 976
183
- assert os.partialupfront_prepay_3_year == 1239
184
- assert os.allupfront_prepay_3_year == 1935
185
- assert os.noupfront_effective_rate_1_year == 0.1320
186
- assert os.partialupfront_effective_rate_1_year == 0.1131
187
- assert os.allupfront_effective_rate_1_year == 0.1114
188
- assert os.partialupfront_effective_rate_3_year == 0.0781
189
- assert os.allupfront_effective_rate_3_year == 0.0736
180
+ assert os.ondemand_price_per_hour == 0.2
181
+ assert os.partialupfront_prepay_1_year == 617
182
+ assert os.allupfront_prepay_1_year == 927
183
+ assert os.partialupfront_prepay_3_year == 1177
184
+ assert os.allupfront_prepay_3_year == 1838
185
+ assert os.noupfront_effective_rate_1_year == 0.125
186
+ assert os.partialupfront_effective_rate_1_year == 0.1074
187
+ assert os.allupfront_effective_rate_1_year == 0.1058
188
+ assert os.partialupfront_effective_rate_3_year == 0.0738
189
+ assert os.allupfront_effective_rate_3_year == 0.0699
190
190
  end
191
-
192
-
193
-
194
191
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amazon-pricing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.72
4
+ version: 0.1.73
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Kinsella
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-29 00:00:00.000000000 Z
11
+ date: 2016-01-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A Ruby library for retrieving pricing for Amazon Web Services
14
14
  email:
@@ -96,3 +96,4 @@ test_files:
96
96
  - spec/support/.gitignore
97
97
  - test/ec2_instance_types_test.rb
98
98
  - test/helper.rb
99
+ has_rdoc: