Commit 4e138236 authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Fix deletion of ssh keys

parent 2717c6ae
......@@ -348,9 +348,9 @@ class SSHPublicKey(models.Model):
# when a key is withdrawn by a client we try to finally delete it
def try_final_deletion(self):
if (self.deleted
and not self.task_items.exists()):
self.print('All clients have withdrawn this key. Final deletion')
if (self.deleted and not self.tasks.exists()):
logger.info(self.msg(
'All clients have withdrawn this key. Final deletion'))
self.delete()
return
......@@ -526,6 +526,7 @@ class DeploymentTask(models.Model):
# maintenance after all task items are done
def finished(self):
logger.info(self.msg('done'))
self.delete()
# check if this was the final withdraw in a key deletion
if self.action == 'withdraw':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment