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

In cleanup_mail sysprep check if mail dirs exist

Check if /var/spool/mail exists before trying to remove the content
of the directory.
parent fa65eda1
No related branches found
No related tags found
No related merge requests found
......@@ -85,7 +85,9 @@ class Unix(OSBase):
if print_header:
self.out.output('Removing files under /var/mail & /var/spool/mail')
self.foreach_file('/var/spool/mail', self.g.rm_rf, maxdepth=1)
if self.g.is_dir('/var/spool/mail'):
self.foreach_file('/var/spool/mail', self.g.rm_rf, maxdepth=1)
self.foreach_file('/var/mail', self.g.rm_rf, maxdepth=1)
@sysprep()
......
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