def __del__(self):
self.cleanup()
- self.packages.close()
def addRelease(self, cache_path, file_path):
"""Dirty hack until python-apt supports apt-pkg/indexrecords.h
def cleanup(self):
"""Cleanup and close any loaded caches."""
self.unload()
+ if self.unload_later and self.unload_later.active():
+ self.unload_later.cancel()
self.packages.close()
def findHash(self, path):
d.errback(MirrorError("Site Not Found"))
return d
+ def cleanup(self):
+ for site in self.apt_caches.keys():
+ for baseDir in self.apt_caches[site].keys():
+ self.apt_caches[site][baseDir].cleanup()
+ del self.apt_caches[site][baseDir]
+ del self.apt_caches[site]
+
class TestMirrorManager(unittest.TestCase):
"""Unit tests for the mirror manager."""
for p in self.pending_calls:
if p.active():
p.cancel()
+ self.client.cleanup()
self.client = None
\ No newline at end of file