1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-23 22:55:23 +00:00

sshkeys view can send keys in plain format

This commit is contained in:
Ing. Jan KRCMAR 2018-04-05 16:26:17 +02:00
parent 1ad2f03b52
commit 41095ffb6d

View file

@ -925,7 +925,12 @@ def sshkeys(request, vname):
keys = UserSSHKey.objects.filter(user=ui.user)
for k in keys:
instance_keys.append(k.keypublic)
return HttpResponse(json.dumps(instance_keys))
if request.GET.get('plain', ''):
response = '\n'.join(instance_keys)
response += '\n'
else:
response = json.dumps(instance_keys)
return HttpResponse(response)
def delete_instance(instance, delete_disk=False):
compute = instance.compute