From 49dc2f1d3fd8623cf12efd8aaf729c3de39121fc Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Mon, 24 May 2010 20:26:23 +0200 Subject: [PATCH] [molecule] remaster_plugin: fix directory leaking --- molecule/specs/plugins/remaster_plugin.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/molecule/specs/plugins/remaster_plugin.py b/molecule/specs/plugins/remaster_plugin.py index 0da761e..a8c751d 100644 --- a/molecule/specs/plugins/remaster_plugin.py +++ b/molecule/specs/plugins/remaster_plugin.py @@ -301,11 +301,10 @@ class IsoHandler(BuiltinIsoHandler): def kill(self, success = True): BuiltinIsoHandler.kill(self, success = success) - if not success: - try: - shutil.rmtree(self.metadata['chroot_tmp_dir'], True) - except (shutil.Error, OSError,): - pass + try: + shutil.rmtree(self.metadata['chroot_tmp_dir'], True) + except (shutil.Error, OSError,): + pass return 0