X-Git-Url: https://code.grnet.gr/git/snf-image-creator/blobdiff_plain/c5effe03956a8200b923dfbc528abb80be45bdcb..6f391961317833dba163eb4cda1685264e1a1de5:/image_creator/os_type/unix.py diff --git a/image_creator/os_type/unix.py b/image_creator/os_type/unix.py index 504f2ad..7e3ba22 100644 --- a/image_creator/os_type/unix.py +++ b/image_creator/os_type/unix.py @@ -121,12 +121,18 @@ class Unix(OSBase): if self.g.is_dir('/home/'): homedirs += self._ls('/home/') + action = self.g.rm_rf + if self._scrub_support: + action = self.g.scrub_file + else: + self.out.warn("Sensitive data won't be scrubbed (not supported)") + for homedir in homedirs: for data in self.sensitive_userdata: fname = "%s/%s" % (homedir, data) if self.g.is_file(fname): - self.g.scrub_file(fname) + action(fname) elif self.g.is_dir(fname): - self._foreach_file(fname, self.g.scrub_file, ftype='r') + self._foreach_file(fname, action, ftype='r') # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :