[PATCH] download-logs: print a message when there are no logs to download

Mike McLean mikem at redhat.com
Wed Jun 17 22:01:14 UTC 2015


see: https://bugzilla.redhat.com/show_bug.cgi?id=1232916
---
 cli/koji | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/cli/koji b/cli/koji
index 908d829..9ec098d 100755
--- a/cli/koji
+++ b/cli/koji
@@ -6229,15 +6229,21 @@ def anon_handle_download_logs(options, session, args):
         task_log_dir = os.path.join(parent_dir,
                                     "%s-%s" % (task_info["arch"], task_id))
 
+        count = 0
         state =  koji.TASK_STATES[task_info['state']]
         if state == 'FAILED':
             if not match or koji.util.multi_fnmatch(FAIL_LOG, match):
                 write_fail_log(task_log_dir, task_id)
+                count += 1
         elif state not in ['CLOSED', 'CANCELED']:
             sys.stderr.write(_("Warning: task %s is %s\n") % (task_id, state))
 
         for log_filename in logs:
             download_log(task_log_dir, task_id, log_filename)
+            count += 1
+
+        if count == 0 and not recurse:
+            sys.stderr.write(_("No logs found for task %i. Perhaps try --recurse?\n") % task_id)
 
         if recurse:
             child_tasks = session.getTaskChildren(task_id)
-- 
1.9.3



More information about the koji-devel mailing list