Skip to content
Snippets Groups Projects
Commit f6ea8d02 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Fix a bug in tmp dir removal

snf-image-creator removed /var/tmp if the directory was empty
parent aab4b154
No related branches found
No related tags found
No related merge requests found
......@@ -45,6 +45,7 @@ import uuid
import re
import sys
import guestfs
import shutil
from sendfile import sendfile
......@@ -77,7 +78,7 @@ class Disk(object):
self.tmp = tempfile.mkdtemp(prefix='.snf_image_creator.',
dir=self._get_tmp_dir(tmp))
self._add_cleanup(os.removedirs, self.tmp)
self._add_cleanup(shutil.rmtree, self.tmp)
def _get_tmp_dir(self, default=None):
if default is not None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment