forked from 3wordchant/capsul-flask
fixing capsul creation after I broke it with the pre-allocated IP
address changes
This commit is contained in:
@ -245,20 +245,17 @@ def create():
|
||||
|
||||
if len(errors) == 0:
|
||||
id = make_capsul_id()
|
||||
get_model().create_vm(
|
||||
email=session["account"],
|
||||
id=id,
|
||||
size=size,
|
||||
os=os,
|
||||
ssh_authorized_keys=list(map(lambda x: x["name"], posted_keys))
|
||||
)
|
||||
# we can't create the vm record in the DB yet because its IP address needs to be allocated first.
|
||||
# so it will be created when the allocation happens inside the hub_api.
|
||||
current_app.config["HUB_MODEL"].create(
|
||||
email = session["account"],
|
||||
id=id,
|
||||
os=os,
|
||||
size=size,
|
||||
template_image_file_name=operating_systems[os]['template_image_file_name'],
|
||||
vcpus=vm_sizes[size]['vcpus'],
|
||||
memory_mb=vm_sizes[size]['memory_mb'],
|
||||
ssh_authorized_keys=list(map(lambda x: x["content"], posted_keys))
|
||||
ssh_authorized_keys=list(map(lambda x: dict(name=x['name'], content=x['content']), posted_keys))
|
||||
)
|
||||
|
||||
return redirect(f"{url_for('console.index')}?created={id}")
|
||||
|
Reference in New Issue
Block a user