Commit f6ea8d02 authored by Nikos Skalkotos's avatar Nikos Skalkotos

Fix a bug in tmp dir removal

snf-image-creator removed /var/tmp if the directory was empty
parent aab4b154
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment