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>
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 @@
                     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: