@@ -182,19 +182,24 @@ def audit_task(self, task):
182
182
else :
183
183
command = None
184
184
185
- path_hash_dict = {}
186
-
187
185
attr_list = attr_fields (task .inputs )
188
186
for attrs in attr_list :
189
187
if attrs .type in [File , Directory ]:
190
188
input_name = attrs .name
191
189
input_path = os .path .abspath (getattr (task .inputs , input_name ))
192
190
file_hash = hash_file (input_path )
193
- path_hash_dict [input_path ] = file_hash
191
+ entity_id = f"uid:{ gen_uuid ()} "
192
+ entity_message = {
193
+ "@id" : entity_id ,
194
+ "Label" : print (entity_label ),
195
+ "AtLocation" : input_path ,
196
+ "GeneratedBy" : "test" ,
197
+ "@type" : "input" ,
198
+ "digest" : file_hash
199
+ }
200
+ self .audit_message (entity_message , AuditFlag .PROV )
201
+
194
202
195
- # get the hash for the output
196
- input_paths = list (path_hash_dict .keys ())
197
- input_paths_hash = list (path_hash_dict .values ())
198
203
199
204
if command is not None :
200
205
cmd_name = command .split ()[0 ]
@@ -222,15 +227,9 @@ def audit_task(self, task):
222
227
"StartedAtTime" : now (),
223
228
"AssociatedWith" : version_cmd ,
224
229
}
225
- entity_id = f"uid:{ gen_uuid ()} "
226
- entity_message = {
227
- "@id" : entity_id ,
228
- "Label" : print (entity_label ),
229
- "AtLocation" : input_paths , #
230
- "GeneratedBy" : "test" ,
231
- "@type" : "input" ,
232
- "digest" : input_paths_hash ,
233
- }
230
+
231
+
234
232
235
233
self .audit_message (start_message , AuditFlag .PROV )
236
- self .audit_message (entity_message , AuditFlag .PROV )
234
+
235
+
0 commit comments