Skip to content

Commit

Permalink
Merge pull request #83 from mineralsfree/ENT-11138
Browse files Browse the repository at this point in the history
ENT-11138: proper error message when typing unsupported/unknown platform
  • Loading branch information
olehermanse authored Mar 18, 2024
2 parents 9fa1ce6 + 580d1f7 commit 4f188b2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cf_remote/spawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from cf_remote.cloud_data import aws_platforms
from cf_remote.utils import whoami
from cf_remote import log

from cf_remote import cloud_data

_NAME_RANDOM_PART_LENGTH = 4

Expand Down Expand Up @@ -323,7 +323,9 @@ def spawn_vm_in_aws(
else:
if any(vm.state in (0, "running") and vm.name == name for vm in existing_vms):
raise ValueError("VM with the name '%s' already exists" % name)

if not platform in aws_platforms:
raise ValueError("Platform '%s' does not exist.\nList of available platforms:\n%s" % (platform,
"\n".join(cloud_data.aws_platforms.keys())))
aws_platform = aws_platforms[platform]
size = size or aws_platform.get("xlsize") or aws_platform["size"]
user = aws_platform.get("user")
Expand Down

0 comments on commit 4f188b2

Please sign in to comment.