Skip to content

Commit

Permalink
fix: Check for existence.
Browse files Browse the repository at this point in the history
  • Loading branch information
brookemckim committed Sep 27, 2024
1 parent 1cd50ed commit 40027ed
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions opensearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,19 @@ def add_volume_quotas(instances):
max_ebs_gp2 = etree.tostring(r[2], method="text").strip().decode()
max_ebs_gp3 = etree.tostring(r[3], method="text").strip().decode()

instances[instance_type]["min_ebs"] = min_ebs
instances[instance_type]["max_ebs_gp2"] = max_ebs_gp2
instances[instance_type]["max_ebs_gp3"] = max_ebs_gp3
if instance_type in instances:
instances[instance_type]["min_ebs"] = min_ebs
instances[instance_type]["max_ebs_gp2"] = max_ebs_gp2
instances[instance_type]["max_ebs_gp3"] = max_ebs_gp3

table = tree.xpath('//div[@class="table-contents disable-scroll"]//table')[2]
rows = table.xpath(".//tr[./td]")
for r in rows:
instance_type = etree.tostring(r[0], method="text").strip().decode()
max_http_payload = etree.tostring(r[1], method="text").strip().decode()

instances[instance_type]["max_http_payload"] = max_http_payload
if instance_type in instances:
instances[instance_type]["max_http_payload"] = max_http_payload

# Manually add ultrawarm storage
instances["ultrawarm1.medium.search"]["max_storage"] = "1.5 TiB"
Expand Down

0 comments on commit 40027ed

Please sign in to comment.