summaryrefslogtreecommitdiff
path: root/morphlib/localrepocache.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-04-09 18:19:16 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-04-09 18:19:16 +0100
commitaa47f79da62be1320c0b975edb55054b24448d7f (patch)
tree7fd0635d714f8967b5205410f8097b3ff533d6a7 /morphlib/localrepocache.py
parentcc9d92874c159b65b248f8f8f7e164aa32416836 (diff)
downloadmorph-aa47f79da62be1320c0b975edb55054b24448d7f.tar.gz
Remove downloaded bundle after it has been cloned
Diffstat (limited to 'morphlib/localrepocache.py')
-rw-r--r--morphlib/localrepocache.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/morphlib/localrepocache.py b/morphlib/localrepocache.py
index 9beba4af..c6ede082 100644
--- a/morphlib/localrepocache.py
+++ b/morphlib/localrepocache.py
@@ -117,6 +117,15 @@ class LocalRepoCache(object):
source_handle.close()
target_handle.close()
+ def _remove(self, filename): # pragma: no cover
+ '''Remove given file.
+
+ This method is meant to be overridden by unit tests.
+
+ '''
+
+ os.remove(filename)
+
def _escape(self, url):
'''Escape a URL so it can be used as a basename in a file.'''
@@ -152,6 +161,7 @@ class LocalRepoCache(object):
bundle_path = path + '.bundle'
if self._fetch(bundle_url, bundle_path):
self._git(['clone', bundle_path, path])
+ self._remove(bundle_path)
return True
else:
return False