In _foreach_file check if the directory exists
[snf-image-creator] / image_creator / os_type / unix.py
index 8779b76..7255f44 100644 (file)
@@ -108,9 +108,7 @@ class Unix(OSBase):
     def cleanup_mail(self):
         """Remove all files under /var/mail and /var/spool/mail"""
 
-        if self.image.g.is_dir('/var/spool/mail'):
-            self._foreach_file('/var/spool/mail', self.image.g.rm_rf,
-                               maxdepth=1)
+        self._foreach_file('/var/spool/mail', self.image.g.rm_rf, maxdepth=1)
 
         self._foreach_file('/var/mail', self.image.g.rm_rf, maxdepth=1)