Merge branch 'hotfix-0.4.4' into develop
[snf-image-creator] / image_creator / os_type / slackware.py
index 5b0b571..c708515 100644 (file)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+#
 # Copyright 2012 GRNET S.A. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
+"""This module hosts OS-specific code for Slackware Linux"""
+
 from image_creator.os_type.linux import Linux, sysprep
 
 
 class Slackware(Linux):
     """OS class for Slackware Linux"""
-    @sysprep()
-    def cleanup_log(self, print_header=True):
+    @sysprep("Emptying all files under /var/log")
+    def cleanup_log(self):
         """Empty all files under /var/log"""
 
-        if print_header:
-            self.out.output('Emptying all files under /var/log')
-
         # In slackware the metadata about installed packages are
         # stored in /var/log/packages. Clearing all /var/log files
         # will destroy the package management system.
-        self.foreach_file('/var/log', self.g.truncate, ftype='r',
-                          exclude='/var/log/packages')
+        self._foreach_file('/var/log', self.g.truncate, ftype='r',
+                           exclude='/var/log/packages')
 
 # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :