Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
feudal
feudalBackend
Commits
4e138236
Commit
4e138236
authored
Feb 28, 2018
by
Lukas Burgey
Browse files
Fix deletion of ssh keys
parent
2717c6ae
Changes
1
Show whitespace changes
Inline
Side-by-side
django_backend/backend/models.py
View file @
4e138236
...
@@ -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'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment