Test iot certs' validity dates

This commit is contained in:
cătălin 2021-07-23 12:25:50 +02:00
commit 457b18b2db
9 changed files with 38 additions and 27 deletions

View file

@ -37,7 +37,9 @@ def main():
for region in regions:
for location_type in TYPES:
ec2 = boto3.client("ec2", region_name=region)
dest = os.path.join(root_dir, "{0}/{1}/{2}.json".format(PATH, location_type, region))
dest = os.path.join(
root_dir, "{0}/{1}/{2}.json".format(PATH, location_type, region)
)
try:
instances = []
offerings = ec2.describe_instance_type_offerings(
@ -47,8 +49,7 @@ def main():
next_token = offerings.get("NextToken", "")
while next_token:
offerings = ec2.describe_instance_type_offerings(
LocationType=location_type,
NextToken=next_token
LocationType=location_type, NextToken=next_token
)
instances.extend(offerings["InstanceTypeOfferings"])
next_token = offerings.get("NextToken", None)

View file

@ -26,9 +26,7 @@ def main():
instances.extend(offerings["InstanceTypes"])
next_token = offerings.get("NextToken", "")
while next_token:
offerings = ec2.describe_instance_types(
NextToken=next_token
)
offerings = ec2.describe_instance_types(NextToken=next_token)
instances.extend(offerings["InstanceTypes"])
next_token = offerings.get("NextToken", None)
except Exception:
@ -39,7 +37,7 @@ def main():
print("Parsing data")
result = {}
for instance in instances:
result[instance.get('InstanceType')] = instance
result[instance.get("InstanceType")] = instance
root_dir = (
subprocess.check_output(["git", "rev-parse", "--show-toplevel"])