Skip to content

Commit d1e3c58

Browse files
Ryan CaliRyan Cali
authored andcommitted
Addressed all issues in audit
1 parent 230d0ef commit d1e3c58

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

pydra/engine/audit.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -174,31 +174,30 @@ def audit_task(self, task):
174174
import subprocess as sp
175175

176176
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+
184178

179+
command = task.cmdline if hasattr(task.inputs, "executable") else None
185180
attr_list = attr_fields(task.inputs)
186181
for attrs in attr_list:
187182
if attrs.type in [File, Directory]:
188183
input_name = attrs.name
184+
entity_label = attrs.name
189185
input_path = os.path.abspath(getattr(task.inputs, input_name))
190186
file_hash = hash_file(input_path)
191187
entity_id = f"uid:{gen_uuid()}"
192188
entity_message = {
193-
"@id": entity_id,
194-
"Label": print(entity_label),
189+
"@id": entity_id,
190+
"Label": entity_label,
195191
"AtLocation": input_path,
196-
"GeneratedBy": "test",
192+
"GeneratedBy": None,
197193
"@type": "input",
198194
"digest": file_hash,
199195
}
200196
self.audit_message(entity_message, AuditFlag.PROV)
201197

198+
199+
200+
202201
if command is not None:
203202
cmd_name = command.split()[0]
204203
software = f"{cmd_name} --version"
@@ -226,4 +225,6 @@ def audit_task(self, task):
226225
"AssociatedWith": version_cmd,
227226
}
228227

228+
229+
229230
self.audit_message(start_message, AuditFlag.PROV)

0 commit comments

Comments
 (0)