| |
@@ -4454,7 +4454,7 @@
|
| |
return None
|
| |
|
| |
|
| |
- def list_task_output(taskID, stat=False, all_volumes=False):
|
| |
+ def list_task_output(taskID, stat=False, all_volumes=False, strict=False):
|
| |
"""List the files generated by the task with the given ID. This
|
| |
will usually include one or more RPMs, and one or more log files.
|
| |
If the task did not generate any files, or the output directory
|
| |
@@ -4482,7 +4482,17 @@
|
| |
}
|
| |
}
|
| |
}
|
| |
+
|
| |
+ If strict is set, function will raise a GenericError if task doesn't
|
| |
+ exist. Allows user to distinguish between empty output and non-existent task.
|
| |
"""
|
| |
+ if strict:
|
| |
+ # raise error if task doesn't exist
|
| |
+ try:
|
| |
+ Task(taskID).getInfo(strict=True)
|
| |
+ except:
|
| |
+ raise koji.GenericError("Task doesn't exist")
|
| |
+
|
| |
if stat or all_volumes:
|
| |
result = {}
|
| |
else:
|
| |
Added strict option
Fixes: https://pagure.io/koji/issue/1048