Skip to content

Commit 8df54e7

Browse files
author
Jerjou Cheng
committed
Remove unnecessary file comparison.
1 parent a1b5e56 commit 8df54e7

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

storage/api/crud_object.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"""
2525

2626
import argparse
27-
import filecmp
2827
import json
2928
import tempfile
3029

@@ -40,12 +39,8 @@ def main(bucket, filename, readers=[], owners=[]):
4039
print(json.dumps(resp, indent=2))
4140

4241
print('Fetching object..')
43-
with tempfile.NamedTemporaryFile(mode='w+b') as tmpfile:
42+
with tempfile.TemporaryFile(mode='w+b') as tmpfile:
4443
get_object(bucket, filename, out_file=tmpfile)
45-
tmpfile.seek(0)
46-
47-
if not filecmp.cmp(filename, tmpfile.name):
48-
raise Exception('Downloaded file != uploaded object')
4944

5045
print('Deleting object..')
5146
resp = delete_object(bucket, filename)

0 commit comments

Comments
 (0)