- def list_sysprep(self):
- """List all sysprep actions"""
-
- is_sysprep = lambda x: x.startswith('sysprep_') and \
- callable(getattr(self, x))
- tasks = [getattr(self, x) for x in dir(self) if is_sysprep(x)]
-
- included = [t for t in tasks if not getattr(t, "excluded", False)]
- excluded = [t for t in tasks if getattr(t, "excluded", False)]
-
- return included, excluded
-
- def list_data_cleanup(self):
- """List all data_cleanup actions"""
-
- is_cleanup = lambda x: x.startswith('data_cleanup_') and \
- callable(getattr(self, x))
- tasks = [getattr(self, x) for x in dir(self) if is_cleanup(x)]
-
- included = [t for t in tasks if not getattr(t, "excluded", False)]
- excluded = [t for t in tasks if getattr(t, "excluded", False)]
-
- return included, excluded
-
- def data_cleanup(self):
- """Cleanup sensitive data out of the OS image."""
-
- output('Cleaning up sensitive data out of the OS image:')
-
- tasks, _ = self.list_data_cleanup()
- size = len(tasks)
- cnt = 0
- for task in tasks:
- cnt += 1
- output(('(%d/%d)' % (cnt, size)).ljust(7), False)
- task()
- output()
-
- def sysprep(self):