File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -174,31 +174,30 @@ def audit_task(self, task):
174
174
import subprocess as sp
175
175
176
176
label = task .name
177
- entity_label = type (label )
178
-
179
- if hasattr (task .inputs , "executable" ):
180
- command = task .cmdline
181
- # assume function task
182
- else :
183
- command = None
177
+
184
178
179
+ command = task .cmdline if hasattr (task .inputs , "executable" ) else None
185
180
attr_list = attr_fields (task .inputs )
186
181
for attrs in attr_list :
187
182
if attrs .type in [File , Directory ]:
188
183
input_name = attrs .name
184
+ entity_label = attrs .name
189
185
input_path = os .path .abspath (getattr (task .inputs , input_name ))
190
186
file_hash = hash_file (input_path )
191
187
entity_id = f"uid:{ gen_uuid ()} "
192
188
entity_message = {
193
- "@id" : entity_id ,
194
- "Label" : print ( entity_label ) ,
189
+ "@id" : entity_id ,
190
+ "Label" : entity_label ,
195
191
"AtLocation" : input_path ,
196
- "GeneratedBy" : "test" ,
192
+ "GeneratedBy" : None ,
197
193
"@type" : "input" ,
198
194
"digest" : file_hash ,
199
195
}
200
196
self .audit_message (entity_message , AuditFlag .PROV )
201
197
198
+
199
+
200
+
202
201
if command is not None :
203
202
cmd_name = command .split ()[0 ]
204
203
software = f"{ cmd_name } --version"
@@ -226,4 +225,6 @@ def audit_task(self, task):
226
225
"AssociatedWith" : version_cmd ,
227
226
}
228
227
228
+
229
+
229
230
self .audit_message (start_message , AuditFlag .PROV )
You can’t perform that action at this time.
0 commit comments