File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -76,13 +76,11 @@ def get_size(self, name):
76
76
except minio .error .S3Error as e :
77
77
if e .code == 'NoSuchKey' :
78
78
raise errors .MissingExternalFile
79
- raise e
79
+ raise e
80
80
81
81
def remove_object (self , name ):
82
82
logger .debug ('remove_object: {}:{}' .format (self .bucket , name ))
83
83
try :
84
84
self .client .remove_object (self .bucket , str (name ))
85
85
except minio .error .MinioException :
86
86
raise errors .DataJointError ('Failed to delete %s from s3 storage' % name )
87
- except ValueError :
88
- raise errors .DataJointError ('minIO ValueError something is wrong with the strings passed' )
Original file line number Diff line number Diff line change @@ -122,15 +122,16 @@ def test_remove_object_exception():
122
122
schema .external ['share' ].s3 .client = minio_client
123
123
124
124
# This method returns a list of errors
125
- error_list = schema .external ['share' ].delete (delete_external_files = True , errors_as_string = False )
125
+ error_list = schema .external ['share' ].delete (delete_external_files = True ,
126
+ errors_as_string = False )
126
127
127
128
# Teardown
129
+ print (error_list [0 ][0 ])
128
130
os .system ('mc admin policy remove myminio test' )
129
131
os .system ('mc admin user remove myminio jeffjeff' )
130
-
131
- # minio_admin.user_remove(access_key = 'jeffjeff')
132
- # minio_admin.policy_remove('test')
133
132
schema .external ['share' ].s3 .client = old_client
134
-
135
- # Raise the error we want
136
- raise error_list [0 ][2 ]
133
+ schema .external ['share' ].delete (delete_external_files = True )
134
+ os .remove ("/tmp/policy.json" )
135
+ # Raise the error we want if the error matches the expected uuid
136
+ if str (error_list [0 ][0 ]) == '4c16e9e1-5b64-474e-4b56-ba22bb17faae' :
137
+ raise error_list [0 ][2 ]
You can’t perform that action at this time.
0 commit comments