Hotfix: ssh root key adding

pull/6/head
Inex Code 2021-11-17 11:18:17 +02:00
parent 82b7f97dce
commit 8700642260
1 changed files with 2 additions and 2 deletions

View File

@ -98,12 +98,12 @@ class WriteSSHKey(Resource):
if "ssh" not in data:
data["ssh"] = {}
# Return 409 if key already in array
for key in data["ssh"]["rootSshKeys"]:
for key in data["ssh"]["rootKeys"]:
if key == public_key:
return {
"error": "Key already exists",
}, 409
data["ssh"]["rootSshKeys"].append(public_key)
data["ssh"]["rootKeys"].append(public_key)
userdata_file.seek(0)
json.dump(data, userdata_file, indent=4)
userdata_file.truncate()