From f0881ee38ccc1ef5e3f940e55c77a91702f3bfca Mon Sep 17 00:00:00 2001 From: Yonghee Han Date: Mon, 28 Nov 2016 11:22:24 +0900 Subject: [PATCH] Cleanup repo directory when have a previous directory Change-Id: Ie69a78384c970f6a62b1377ed69c80be7ea0ffb8 --- job_pre_release_obs.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/job_pre_release_obs.py b/job_pre_release_obs.py index 70c77c2..6bad059 100755 --- a/job_pre_release_obs.py +++ b/job_pre_release_obs.py @@ -157,6 +157,11 @@ def make_repo(project, repo, backenddb, base_url, base_path, project.replace(':', ':/')) targets = snapshot.targets + # Cleanup repo directory + if os.path.isdir(os.path.join(prerelease.path, prerelease.build_id)): + print " repo path=%s exits. Cleanup repo directory" % os.path.join(prerelease.path, prerelease.build_id) + shutil.rmtree(os.path.join(prerelease.path, prerelease.build_id)) + if buildmonitor_enabled: global bm_snapshot_name global bm_snapshot_url -- 2.7.4