fix typos
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Wed, 13 Jan 2016 17:10:12 +0000 (18:10 +0100)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Wed, 13 Jan 2016 17:10:12 +0000 (18:10 +0100)
file_helpers.py
test_helpers.py

index 96acbb7..3610c7b 100644 (file)
@@ -62,7 +62,8 @@ class FilesystemFillState:
 def get_filesystem_fill_states():
     """ get fill state on all filesystems
 
-    parses the output of cmd 'df', returns list of :py:class:`FilesystemFillState`
+    parses the output of cmd 'df', returns list of
+    :py:class:`FilesystemFillState`
     """
 
     # call
@@ -82,7 +83,7 @@ def get_filesystem_fill_states():
 
     # check columns and their header
     if len(separator_cols) != 5:
-        raise ValueError('unepexpected number of separator columns: {0}'
+        raise ValueError('unexpected number of separator columns: {0}'
                          .format(separator_cols))  # must eliminate neighbours?
 
     title_line = out[0]
index 548071b..3942f0f 100644 (file)
@@ -35,8 +35,8 @@ class DiscFullPreventionError(Exception):
     """
     def __init__(self, state, time_estim):
         super(DiscFullPreventionError, self).__init__(
-            'Interrupting test to avoid full disc ({0}, full in {1} s)'
-            .format(state, time_estim))
+            'Interrupting test to avoid full disc ({0}, full in {1}s)'
+            .format(state, "?" if time_estim==None else time_estim))
         self.state = state
         self.time_estim = time_estim
 
@@ -51,7 +51,8 @@ class DiscFullPreventionWarning(WARN_BASE_CLASS):
     def __init__(self, state, time_estim):
         super(DiscFullPreventionWarning, self).__init__(
               'Disc nearly full! Might soon abort test ({0}, '
-              'full in {1} s)'.format(state, time_estim))
+              'full in {1}s)'
+              .format(state, "?" if time_estim==None else time_estim))
         self.state = state
         self.time_estim = time_estim
 
@@ -59,7 +60,7 @@ class DiscFullPreventionWarning(WARN_BASE_CLASS):
 class DiscFillCheckerThread(Thread):
     """ a thread that checks disc fill in regular intervals """
 
-    def __init__(self, interval=10, decision_function = None):
+    def __init__(self, interval=10, decision_function=None):
         """ creates a DiscFillCheckerThread
 
         :param int interval: time in seconds between checks of disc usage
@@ -182,7 +183,7 @@ def default_disc_full_decision_function(curr_state,
             raise DiscFullPreventionError(curr_state, estim_empty_smallest)
         elif kill_level == KILL_REALLY_MEAN_EXIT:
             print('Disc fill below tolerance or disc full soon', file=stderr)
-            print('{0}, full in {1:.1f}s'
+            print('{0}, full in {1} s'
                   .format(curr_state, estim_empty_smallest), file=stderr)
             print('Exiting now the brutal way', file=stderr)
             bad_exit_function_that_should_not_be_used(1)