mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-03-18 20:39:46 +00:00
Hotfix: ssh root key adding
This commit is contained in:
parent
82b7f97dce
commit
8700642260
1 changed files with 2 additions and 2 deletions
|
@ -98,12 +98,12 @@ class WriteSSHKey(Resource):
|
||||||
if "ssh" not in data:
|
if "ssh" not in data:
|
||||||
data["ssh"] = {}
|
data["ssh"] = {}
|
||||||
# Return 409 if key already in array
|
# Return 409 if key already in array
|
||||||
for key in data["ssh"]["rootSshKeys"]:
|
for key in data["ssh"]["rootKeys"]:
|
||||||
if key == public_key:
|
if key == public_key:
|
||||||
return {
|
return {
|
||||||
"error": "Key already exists",
|
"error": "Key already exists",
|
||||||
}, 409
|
}, 409
|
||||||
data["ssh"]["rootSshKeys"].append(public_key)
|
data["ssh"]["rootKeys"].append(public_key)
|
||||||
userdata_file.seek(0)
|
userdata_file.seek(0)
|
||||||
json.dump(data, userdata_file, indent=4)
|
json.dump(data, userdata_file, indent=4)
|
||||||
userdata_file.truncate()
|
userdata_file.truncate()
|
||||||
|
|
Loading…
Add table
Reference in a new issue