Bump version to 0.2.8
[snf-image-creator] / image_creator / os_type / unix.py
index fa70805..38dc0fb 100644 (file)
 # or implied, of GRNET S.A.
 
 import re
-import sys
 
 from image_creator.os_type import OSBase, sysprep
 
 
 class Unix(OSBase):
-
+    """OS class for Unix"""
     sensitive_userdata = [
         '.bash_history',
         '.gnupg',
         '.ssh',
-        '.mozilla',
-        '.thunderbird'
+        '.kamakirc',
+        '.kamaki.history'
     ]
 
     def __init__(self, rootdev, ghandler, output):
@@ -56,7 +55,6 @@ class Unix(OSBase):
             self.out.warn("No passworded users found!")
             del self.meta['USERS']
 
-
     def _get_passworded_users(self):
         users = []
         regexp = re.compile('(\S+):((?:!\S+)|(?:[^!*]\S+)|):(?:\S*:){6}')
@@ -203,5 +201,7 @@ class Unix(OSBase):
                 fname = "%s/%s" % (homedir, data)
                 if self.g.is_file(fname):
                     self.g.scrub_file(fname)
+                elif self.g.is_dir(fname):
+                    self.foreach_file(fname, self.g.scrub_file, ftype='r')
 
 # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :