remove extra debug logs
This commit is contained in:
parent
50cea6e0b4
commit
a7c61f01df
@ -117,9 +117,6 @@ def detail(id):
|
||||
vm["created"] = vm['created'].strftime("%b %d %Y %H:%M")
|
||||
vm["ssh_authorized_keys"] = ", ".join(vm["ssh_authorized_keys"]) if len(vm["ssh_authorized_keys"]) > 0 else "<missing>"
|
||||
|
||||
|
||||
current_app.logger.info(f"asd {needs_ssh_host_keys} {json.dumps(vm['ssh_host_keys'])})")
|
||||
|
||||
return render_template(
|
||||
"capsul-detail.html",
|
||||
csrf_token = session["csrf-token"],
|
||||
@ -140,10 +137,6 @@ def create():
|
||||
capacity_avaliable = current_app.config["VIRTUALIZATION_MODEL"].capacity_avaliable(512*1024*1024)
|
||||
errors = list()
|
||||
|
||||
ssh_keys_from_db_string = "\n".join(list(map(lambda x: f"name: {x['name']}**content: {x['content']}", public_keys_for_account)))
|
||||
email_to_log = session["account"]
|
||||
current_app.logger.info(f"create for {email_to_log}: ssh keys from db:\n {ssh_keys_from_db_string}")
|
||||
|
||||
if request.method == "POST":
|
||||
if "csrf-token" not in request.form or request.form['csrf-token'] != session['csrf-token']:
|
||||
return abort(418, f"u want tea")
|
||||
@ -167,15 +160,11 @@ def create():
|
||||
errors.append("something went wrong with ssh keys")
|
||||
else:
|
||||
for i in range(0, posted_keys_count):
|
||||
to_log_bool = f"ssh_key_{i}" in request.form
|
||||
current_app.logger.info(f"checking for ssh_key_{i}: {to_log_bool}")
|
||||
if f"ssh_key_{i}" in request.form:
|
||||
posted_name = request.form[f"ssh_key_{i}"]
|
||||
current_app.logger.info(f"ssh key posted_name: {posted_name}")
|
||||
key = None
|
||||
for x in public_keys_for_account:
|
||||
if x['name'] == posted_name:
|
||||
current_app.logger.info(f"ssh key posted_name {posted_name} was found")
|
||||
key = x
|
||||
if key:
|
||||
posted_keys.append(key)
|
||||
@ -192,9 +181,6 @@ def create():
|
||||
host(s) at capacity. no capsuls can be created at this time. sorry.
|
||||
""")
|
||||
|
||||
posted_keys_string = "\n".join(list(map(lambda x: f"name: {x['name']}**content: {x['content']}", posted_keys)))
|
||||
current_app.logger.info(f"create for {email_to_log}: posted_keys:\n {posted_keys_string}")
|
||||
|
||||
if len(errors) == 0:
|
||||
id = makeCapsulId()
|
||||
get_model().create_vm(
|
||||
|
@ -123,8 +123,6 @@ class DBModel:
|
||||
)
|
||||
|
||||
for ssh_authorized_key in ssh_authorized_keys:
|
||||
current_app.logger.info(f"INSERT INTO vm_ssh_authorized_key (email, vm_id, ssh_public_key_name) VALUES (\"{email}\", \"{id}\", \"{ssh_authorized_key}\")")
|
||||
|
||||
self.cursor.execute("""
|
||||
INSERT INTO vm_ssh_authorized_key (email, vm_id, ssh_public_key_name)
|
||||
VALUES (%s, %s, %s)
|
||||
|
@ -102,9 +102,6 @@ main {
|
||||
.row.grid-large > div {
|
||||
flex: 1 1 20em;
|
||||
}
|
||||
.row.grid-medium > div {
|
||||
flex: 1 1 13em;
|
||||
}
|
||||
.row.grid-small > div {
|
||||
flex: 0 0 8em;
|
||||
}
|
||||
|
@ -147,8 +147,6 @@ class ShellScriptVirtualization(VirtualizationInterface):
|
||||
|
||||
ssh_keys_string = "\n".join(ssh_authorized_keys)
|
||||
|
||||
current_app.logger.info(f"create vm virt model ssh_keys_string: {ssh_keys_string}")
|
||||
|
||||
completedProcess = run([
|
||||
join(current_app.root_path, 'shell_scripts/create.sh'),
|
||||
id,
|
||||
@ -170,8 +168,6 @@ class ShellScriptVirtualization(VirtualizationInterface):
|
||||
ssh_authorized_keys={ssh_keys_string}
|
||||
"""
|
||||
|
||||
current_app.logger.info(f"create vm status: {status} vmSettings: {vmSettings}")
|
||||
|
||||
if not status == "success":
|
||||
raise ValueError(f"""failed to create vm for {email} with:
|
||||
{vmSettings}
|
||||
|
Loading…
Reference in New Issue
Block a user