4 """Check for errors in the bookkeeper file"""
5 with open(bookkeeper_file_path,
'r')
as bookkeeper_file:
6 for line
in bookkeeper_file:
7 if line.find(
"ERROR") != -1:
12 """Check that the transfer is finished in the bookkeeper file"""
14 with open(bookkeeper_file_path,
'r')
as bookkeeper_file:
15 for line
in bookkeeper_file:
16 if line.find(file_name) != -1:
18 if line.find(
"FINISHED") == -1:
23 """Check that the transfer is uploading in the bookkeeper file"""
24 print(
'Check that the transfer is uploading in the bookkeeper file:', file_name)
26 with open(bookkeeper_file_path,
'r')
as bookkeeper_file:
27 for line
in bookkeeper_file:
28 if line.find(file_name) != -1:
30 if line.find(
"UPLOADING") == -1:
35 """Check that the transfer is downloading in the bookkeeper file"""
36 print(
'Check that the transfer is downloading in the bookkeeper file:', file_name)
38 with open(bookkeeper_file_path,
'r')
as bookkeeper_file:
39 for line
in bookkeeper_file:
40 if line.find(file_name) != -1:
42 if line.find(
"DOWNLOADING") == -1:
47 """Check transfer state in the bookkeeper file. Returning list with count(uploading, downloading, finished)"""
48 print(
'Check the transfer state in the bookkeeper logs for file:', file_name)
51 with open(bookkeeper_file_path,
'r')
as bookkeeper_file:
52 for line
in bookkeeper_file:
53 if line.find(file_name) != -1:
55 if "UPLOADING" in line:
57 elif "DOWNLOADING" in line:
59 elif "FINISHED" in line:
check_transfer_uploading(bookkeeper_file_path, file_name)
check_transfer_state(bookkeeper_file_path, file_name)
check_contain_no_errors(bookkeeper_file_path)
check_transfer_downloading(bookkeeper_file_path, file_name)
check_transfer_finished(bookkeeper_file_path, file_name)