From a26432d6655e2833ba62fbf47b5ca0e844fcf4a0 Mon Sep 17 00:00:00 2001 From: parazyd Date: Mon, 8 Oct 2018 13:56:21 +0200 Subject: [PATCH] Remove the jobpath directory when a job is deleted. --- jenkins_backend/sync_jobs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jenkins_backend/sync_jobs.py b/jenkins_backend/sync_jobs.py index 3ba14be..4fea3a4 100755 --- a/jenkins_backend/sync_jobs.py +++ b/jenkins_backend/sync_jobs.py @@ -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'))