Skip to content

Commit

Permalink
on exists
Browse files Browse the repository at this point in the history
  • Loading branch information
bra-fsn committed Jun 18, 2024
1 parent 85490d4 commit 46644b5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions inspector/inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,7 @@
]

RESOURCE_OPTS = {
"aws": dict(
region="us-west-2",
),
"aws": dict(region="us-west-2"),
"gcp": dict(zone="us-central1-a"),
}
USER_DATA = """#!/bin/sh
Expand Down Expand Up @@ -282,11 +280,11 @@ def start(ctx, exclude, start_only):
# sc-runner can't yet handle this vendor
continue
resource_opts = RESOURCE_OPTS.get(vendor, {})
if resource_opts and RESOURCE_OPTS.get(vendor, {}).get("region") not in regions:
if resource_opts and RESOURCE_OPTS.get(vendor, {}).get("region") and RESOURCE_OPTS.get(vendor, {}).get("region") not in regions:
# if this server is unavailable in the default region, use a different one
resource_opts = copy.deepcopy(RESOURCE_OPTS.get(vendor))
resource_opts["region"] = regions.pop()
if resource_opts and RESOURCE_OPTS.get(vendor, {}).get("zone") not in zones:
if resource_opts and RESOURCE_OPTS.get(vendor, {}).get("zone") and RESOURCE_OPTS.get(vendor, {}).get("zone") not in zones:
# if this server is unavailable in the default region, use a different one
resource_opts = copy.deepcopy(RESOURCE_OPTS.get(vendor))
resource_opts["zone"] = zones.pop()
Expand Down

0 comments on commit 46644b5

Please sign in to comment.