mirror of
https://github.com/retspen/webvirtcloud
synced 2025-01-24 22:25:19 +00:00
Fixed error handling from gstfsd in instances
This commit is contained in:
parent
d19ec05638
commit
a942f55854
1 changed files with 5 additions and 2 deletions
|
@ -398,10 +398,13 @@ def add_public_key(request, pk):
|
||||||
if instance.proxy.get_status() == 5:
|
if instance.proxy.get_status() == 5:
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
s.connect((instance.compute.hostname, 16510))
|
s.connect((instance.compute.hostname, 16510))
|
||||||
s.send(json.dumps(data))
|
s.send(json.dumps(data).encode())
|
||||||
result = json.loads(s.recv(1024))
|
result = json.loads(s.recv(1024))
|
||||||
s.close()
|
s.close()
|
||||||
msg = _("Installed new SSH public key %(keyname)s") % {'keyname': publickey.keyname}
|
if result['return'] == 'error':
|
||||||
|
msg = result['message']
|
||||||
|
else:
|
||||||
|
msg = _("Installed new SSH public key %(keyname)s") % {'keyname': publickey.keyname}
|
||||||
addlogmsg(request.user.username, instance.name, msg)
|
addlogmsg(request.user.username, instance.name, msg)
|
||||||
|
|
||||||
if result['return'] == 'success':
|
if result['return'] == 'success':
|
||||||
|
|
Loading…
Reference in a new issue