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): ...@@ -348,9 +348,9 @@ class SSHPublicKey(models.Model):
# when a key is withdrawn by a client we try to finally delete it # when a key is withdrawn by a client we try to finally delete it
def try_final_deletion(self): def try_final_deletion(self):
if (self.deleted if (self.deleted and not self.tasks.exists()):
and not self.task_items.exists()): logger.info(self.msg(
self.print('All clients have withdrawn this key. Final deletion') 'All clients have withdrawn this key. Final deletion'))
self.delete() self.delete()
return return
...@@ -526,6 +526,7 @@ class DeploymentTask(models.Model): ...@@ -526,6 +526,7 @@ class DeploymentTask(models.Model):
# maintenance after all task items are done # maintenance after all task items are done
def finished(self): def finished(self):
logger.info(self.msg('done')) logger.info(self.msg('done'))
self.delete()
# check if this was the final withdraw in a key deletion # check if this was the final withdraw in a key deletion
if self.action == 'withdraw': 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