added a todo and forgotten 'self's
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Thu, 14 Jan 2016 13:04:32 +0000 (14:04 +0100)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Thu, 14 Jan 2016 13:04:32 +0000 (14:04 +0100)
file_helpers.py

index 3610c7b..bfc8db3 100644 (file)
@@ -48,12 +48,12 @@ class FilesystemFillState:
     """
 
     def __init__(self):
-        name = None
-        size = None
-        used = None
-        available = None
-        capacity = None
-        mount_point = None
+        self.name = None
+        self.size = None
+        self.used = None
+        self.available = None
+        self.capacity = None
+        self.mount_point = None
 
     def __str__(self):
         return '[Filesystem {0} mounted at {1}: {2}% used]' \
@@ -64,6 +64,10 @@ def get_filesystem_fill_states():
 
     parses the output of cmd 'df', returns list of
     :py:class:`FilesystemFillState`
+
+    ..todo:: replace call to df (which forks) by call to statvfs combined with
+             some way to find all mounted partitions (parse /proc/mounts
+             whenever it changes)
     """
 
     # call