projects
/
snf-image-creator
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fa65eda
)
In cleanup_mail sysprep check if mail dirs exist
author
Nikos Skalkotos
<skalkoto@grnet.gr>
Thu, 23 May 2013 13:57:01 +0000
(16:57 +0300)
committer
Nikos Skalkotos
<skalkoto@grnet.gr>
Thu, 23 May 2013 13:57:01 +0000
(16:57 +0300)
Check if /var/spool/mail exists before trying to remove the content
of the directory.
image_creator/os_type/unix.py
patch
|
blob
|
history
diff --git
a/image_creator/os_type/unix.py
b/image_creator/os_type/unix.py
index
f2abd0e
..
b0b3ae6
100644
(file)
--- a/
image_creator/os_type/unix.py
+++ b/
image_creator/os_type/unix.py
@@
-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()