mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-24 15:15:22 +00:00
sshkeys view can send keys in plain format
This commit is contained in:
parent
1ad2f03b52
commit
41095ffb6d
1 changed files with 6 additions and 1 deletions
|
@ -925,7 +925,12 @@ def sshkeys(request, vname):
|
||||||
keys = UserSSHKey.objects.filter(user=ui.user)
|
keys = UserSSHKey.objects.filter(user=ui.user)
|
||||||
for k in keys:
|
for k in keys:
|
||||||
instance_keys.append(k.keypublic)
|
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):
|
def delete_instance(instance, delete_disk=False):
|
||||||
compute = instance.compute
|
compute = instance.compute
|
||||||
|
|
Loading…
Reference in a new issue