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
# 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]
"""
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
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
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
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)