This is an automated email from the ASF dual-hosted git repository. micafer pushed a commit to branch fix_scrape_ec2_prices in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit a32a434f18626a7b9a820d404e5488a9a87732b4 Author: Miguel Caballer <[email protected]> AuthorDate: Mon Jan 26 16:37:18 2026 +0100 Fix EC2 scrape pricing script --- contrib/scrape-ec2-prices.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/contrib/scrape-ec2-prices.py b/contrib/scrape-ec2-prices.py index 40c0d6014..8bf768043 100755 --- a/contrib/scrape-ec2-prices.py +++ b/contrib/scrape-ec2-prices.py @@ -194,9 +194,10 @@ def scrape_ec2_pricing(): skus[current_sku]["location"] = value # only get prices of compute instances atm elif (prefix, event) == (f"products.{current_sku}", "end_map"): - if ( - "Compute Instance" not in skus[current_sku]["family"] - and "Dedicated Host" not in skus[current_sku]["family"] + family = skus[current_sku].get("family") + + if family is None or ( + "Compute Instance" not in family and "Dedicated Host" not in family ): del skus[current_sku] @@ -217,7 +218,7 @@ def scrape_ec2_pricing(): if skus[sku]["locationType"] != "AWS Region": continue # skip any SQL - if skus[sku]["preInstalledSw"] != "NA": + if skus[sku].get("preInstalledSw") != "NA": continue os = skus[sku]["os"] @@ -318,7 +319,7 @@ def sort_key_by_numeric_other(key_value): def main(): print( "Scraping EC2 pricing data (if this runs for the first time " - "it has to download a 3GB file, depending on your bandwith " + "it has to download a 7GB file, depending on your bandwith " "it might take a while)...." )
