aboutsummaryrefslogtreecommitdiffstats
path: root/src/dashboard/tasks.py
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2018-10-23 16:11:36 -0400
committerParker Berberian <pberberian@iol.unh.edu>2018-10-24 13:49:35 -0400
commit4f6e3f5069bb682751a5db770e910777fa477b0d (patch)
tree1c087888c93d8d54dc8fce02f856fcb367da853a /src/dashboard/tasks.py
parentebc42347105caa2be52a8337372ae4793fe9182c (diff)
Fixes for access creation and removal
Fixes include: - creating ssh access jobs for users with ssh keys - ensuring vpn access is revoked after booking ends Creates ssh access jobs with the user's ssh keys, if they exist Change-Id: Ia2e9f0c5a2f90b45732a5767a62b87a5a5492b94 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
Diffstat (limited to 'src/dashboard/tasks.py')
-rw-r--r--src/dashboard/tasks.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dashboard/tasks.py b/src/dashboard/tasks.py
index 48008b6..0f7af1c 100644
--- a/src/dashboard/tasks.py
+++ b/src/dashboard/tasks.py
@@ -73,7 +73,11 @@ def booking_poll():
def cleanup_access(qs):
for relation in qs:
- pass # TODO
+ if "vpn" in relation.config.access_type.lower():
+ relation.config.set_revoke(True)
+ relation.config.save()
+ relation.status = JobStatus.NEW
+ relation.save()
cleanup_set = Booking.objects.filter(end__lte=timezone.now()).filter(job__complete=False)