Otherwise print a warning.
* exclude: Exclude all files that follow this pattern.
"""
+ if not self.image.g.is_dir(directory):
+ self.out.warn("Directory: `%s' does not exist!" % directory)
+ return
+
maxdepth = None if 'maxdepth' not in kargs else kargs['maxdepth']
if maxdepth == 0:
return
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)