add hourly cleanup of vnc pipelines

This commit is contained in:
Jordan Rodgers 2018-02-20 02:01:33 -05:00
parent 7166650a4a
commit e5e54d1239
4 changed files with 19 additions and 3 deletions

View file

@ -1,4 +1,5 @@
import os
import requests
import paramiko
from flask import Flask
from sqlalchemy import create_engine
@ -161,3 +162,10 @@ def setup_template(template_id, name, user, password, cores, memory):
exit_status = stdout.channel.recv_exit_status()
client.close()
print("[{}] Template successfully provisioned.".format(name))
def cleanup_vnc_task():
requests.post(
'https://proxstar.csh.rit.edu/console/cleanup',
data={'token': app.config['VNC_CLEANUP_TOKEN']},
verify=False)