Remove the jobpath directory when a job is deleted.

This commit is contained in:
parazyd 2018-10-08 13:56:21 +02:00
parent c277e7a6a8
commit a26432d665
No known key found for this signature in database
GPG Key ID: F0CB28FCF78637DE
1 changed files with 3 additions and 0 deletions

View File

@ -6,6 +6,7 @@ Module for backend talk with Jenkins executed by the web/CGI
from argparse import ArgumentParser
from subprocess import run, PIPE
from os.path import join
from shutil import rmtree
import html
from config import (jarargs, jobpath, pypath)
@ -60,6 +61,8 @@ def del_job(jobname):
"""
Function for deleting a Jenkins job.
"""
rmtree(join(jobpath, jobname), ignore_errors=True)
jarargs.append('delete-job')
jarargs.append(jobname.replace('@', 'AT'))