1
0
mirror of https://github.com/IEEE-SB-Passau/pelican-deployment-system.git synced 2017-09-06 16:35:38 +02:00

use rm utility instead of rmtree

This commit is contained in:
2016-06-20 02:29:46 +02:00
parent e461106ea2
commit 5c80bc4e47

View File

@@ -16,12 +16,11 @@ from pathlib import Path
from collections import namedtuple, deque from collections import namedtuple, deque
from pelican_deploy.gittool import Repo, log_git_result from pelican_deploy.gittool import Repo, log_git_result
from functools import partial from functools import partial
from subprocess import Popen, PIPE from subprocess import Popen, PIPE, check_call
from pelican_deploy.util import exception_logged from pelican_deploy.util import exception_logged
from concurrent.futures import ThreadPoolExecutor from concurrent.futures import ThreadPoolExecutor
from threading import RLock, Thread from threading import RLock, Thread
from datetime import datetime from datetime import datetime
from shutil import rmtree
import pytz import pytz
import sys import sys
import logging import logging
@@ -83,8 +82,10 @@ class DeploymentRunner:
def clean_working_dir_blocking(self, abort_running=True): def clean_working_dir_blocking(self, abort_running=True):
def clean_fn(): def clean_fn():
rmtree(str(self.build_repo_path)) rmpaths = map(shlex.split, [str(self.build_repo_path),
rmtree(str(self._output_dir)) str(self._output_dir)])
for p in rmpaths:
check_call(["rm", "-rf"] + p)
with self._build_lock: with self._build_lock:
if abort_running: if abort_running: