Skip to content

Commit 0ab8667

Browse files
committed
Revert "set exit code to 1 on failure"
This reverts commit d9d219a.
1 parent d9d219a commit 0ab8667

File tree

3 files changed

+28
-30
lines changed

3 files changed

+28
-30
lines changed

checker/bin/check_md5sum

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,39 @@ import json
66
import sys
77
import os
88

9-
109
def main():
11-
parser = argparse.ArgumentParser(description='Checks to see if a given file contains a certain string and then returns a JSON.', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
12-
parser.add_argument('--input-file', type=str, help='file input')
13-
parser.add_argument('--md5', type=str, help='expected md5')
14-
args = parser.parse_args()
15-
16-
result_code = check_file(args.input_file, args.md5)
10+
parser = argparse.ArgumentParser(description='Checks to see if a given file contains a certain string and then returns a JSON.', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
11+
parser.add_argument('--input-file', type=str, help='file input')
12+
parser.add_argument('--md5', type=str, help='expected md5')
13+
args = parser.parse_args()
1714

18-
results_file = open("results.json", "w")
19-
if result_code == 0:
20-
results_file.write('{ "overall" : true, "steps" : { "md5sum_check" : true } }')
21-
else:
22-
results_file.write('{ "overall" : false, "steps" : { "md5sum_check" : false } }')
23-
results_file.close()
15+
result = check_file(args.input_file, args.md5)
2416

25-
log_file = open("log.txt", "w")
26-
log_file.write("")
27-
log_file.close()
17+
results_file = open("results.json", "w")
18+
if (result == 0):
19+
results_file.write('{ "overall" : true, "steps" : { "md5sum_check" : true } }')
20+
else:
21+
results_file.write('{ "overall" : false, "steps" : { "md5sum_check" : false } }')
22+
results_file.close()
2823

29-
sys.exit(result_code)
24+
log_file = open("log.txt", "w")
25+
log_file.write("")
26+
log_file.close()
3027

28+
# correct way to do this?
29+
return(result)
3130

3231
def check_file(input_file, md5):
33-
file = open(input_file, "r")
34-
contents = file.read()
35-
contents = contents.rstrip()
36-
print("FILE CONTENTS: "+contents)
37-
if contents == md5:
38-
print("Contents match")
39-
return 0
40-
else:
41-
print("Contents DO NOT match")
42-
return 1
43-
32+
file = open(input_file, "r")
33+
contents = file.read()
34+
contents = contents.rstrip()
35+
print ("FILE CONTENTS: "+contents)
36+
if (contents == md5):
37+
print("Contents match")
38+
return(0)
39+
else:
40+
print("Contents DO NOT match")
41+
return(1)
4442

4543
if __name__ == "__main__":
4644
main()

checker/md5sum-checker.cwl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cwlVersion: v1.0
77

88
requirements:
99
- class: DockerRequirement
10-
dockerPull: quay.io/dockstore-testing/md5sum-checker
10+
dockerPull: quay.io/agduncan94/checker-md5sum
1111
- class: InlineJavascriptRequirement
1212

1313
hints:

checker/md5sum-checker.wdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ task checkerTask {
77
}
88

99
runtime {
10-
docker: "quay.io/dockstore-testing/md5sum-checker"
10+
docker: "quay.io/agduncan94/checker-md5sum"
1111
}
1212
}

0 commit comments

Comments
 (0)