File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -194,9 +194,10 @@ def scrape_ec2_pricing():
194194 skus [current_sku ]["location" ] = value
195195 # only get prices of compute instances atm
196196 elif (prefix , event ) == (f"products.{ current_sku } " , "end_map" ):
197- if (
198- "Compute Instance" not in skus [current_sku ]["family" ]
199- and "Dedicated Host" not in skus [current_sku ]["family" ]
197+ family = skus [current_sku ].get ("family" )
198+
199+ if family is None or (
200+ "Compute Instance" not in family and "Dedicated Host" not in family
200201 ):
201202 del skus [current_sku ]
202203
@@ -217,7 +218,7 @@ def scrape_ec2_pricing():
217218 if skus [sku ]["locationType" ] != "AWS Region" :
218219 continue
219220 # skip any SQL
220- if skus [sku ][ "preInstalledSw" ] != "NA" :
221+ if skus [sku ]. get ( "preInstalledSw" ) != "NA" :
221222 continue
222223
223224 os = skus [sku ]["os" ]
@@ -318,7 +319,7 @@ def sort_key_by_numeric_other(key_value):
318319def main ():
319320 print (
320321 "Scraping EC2 pricing data (if this runs for the first time "
321- "it has to download a 3GB file, depending on your bandwith "
322+ "it has to download a 7GB file, depending on your bandwith "
322323 "it might take a while)...."
323324 )
324325
You can’t perform that action at this time.
0 commit comments