aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-11-05 18:02:49 -0500
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-11-05 18:02:49 -0500
commitcc74a67c0968dcb9cef830b676855dd5a1cdec42 (patch)
tree1e43de880a14f5892baff36527c558afd1f14e50
parentb8178f63bf5c1f6e06ce78236a7ba97b5467471a (diff)
downloadgrokmirror-cc74a67c0968dcb9cef830b676855dd5a1cdec42.tar.gz
Don't leave .bundle files around
If the connection is reset and we fail to download the entire bundle file, make sure to delete it. Future work: perhaps have support for resuming downloads... Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rwxr-xr-xgrokmirror/pull.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/grokmirror/pull.py b/grokmirror/pull.py
index 162d3e8..238d73d 100755
--- a/grokmirror/pull.py
+++ b/grokmirror/pull.py
@@ -360,6 +360,11 @@ def pull_worker(config, q_pull, q_spa, q_done):
try:
objstore_repo_preload(config, obstrepo)
except: # noqa
+ logger.info(' objstore: not able to preload, will clone repo-by-repo')
+ # Make sure we don't leave .bundle files trailing around
+ bfile = obstrepo[:-4] + '.bundle'
+ if os.path.exists(bfile):
+ os.unlink(bfile)
pass
if r_fp != my_fp: