From 2f059c25737d005e584505d014ecb47402fcf977 Mon Sep 17 00:00:00 2001 From: xudan Date: Wed, 16 Nov 2016 02:33:49 +0000 Subject: dovetail tool: cleanup the result directory before running 1. Jenkins will fail with error rm: cannot remove '/home/opnfv/dovetail/results': Device or resource busy 2. The reason is that Jenkins will mount this directory before running 3. The effective solution is removing all contents in this directory rather than removing this mounted directory JIRA: DOVETAIL-38 Change-Id: Ic32ea19341ad2048322ec11a4abc48e13019a7bb Signed-off-by: xudan --- dovetail/utils/dovetail_logger.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dovetail/utils/dovetail_logger.py') diff --git a/dovetail/utils/dovetail_logger.py b/dovetail/utils/dovetail_logger.py index 9cd8719b..8be9c93f 100644 --- a/dovetail/utils/dovetail_logger.py +++ b/dovetail/utils/dovetail_logger.py @@ -31,8 +31,8 @@ import dovetail_utils as dt_utils def clean_results_dir(): result_path = dovetail_config['result_dir'] if os.path.exists(result_path): - cmd = 'sudo rm -rf %s' % (result_path) - dt_utils.exec_cmd(cmd) + cmd = 'sudo rm -rf %s/*' % (result_path) + dt_utils.exec_cmd(cmd, exit_on_error=False) clean_results_dir() -- cgit 1.2.3-korg