def test_write(testfile_path = "dfs_test.txt", testfile_contents = "Test File Contents", testfile_start_offset = None): params = map(str, (testfile_path, testfile_contents, testfile_start_offset)) print "Running test_write (%s, \"%s\", offset=%s)" % tuple(params) dfs.write(testfile_path, testfile_contents, testfile_start_offset)
def handle_exception(tracefile): """ Write the last traceback to the given file on the DFS. :Parameters: tracefile : string Name of the file where to save the traceback on the DFS """ import traceback type, value, trace = sys.exc_info() message = traceback.format_exception(type, value, trace) errorfile = get_errorfile(tracefile) dfs.write(errorfile, ''.join(message))