#806 honour runroot --quiet for old-style call
Merged 4 years ago by mikem. Opened 4 years ago by tkopecek.
tkopecek/koji runroot-quiet  into  master

file modified
+6 -5
@@ -86,11 +86,12 @@ 

          print("User interrupt: canceling runroot task")

          session.cancelTask(task_id)

          raise

-     output = list_task_output_all_volumes(session, task_id)

-     if 'runroot.log' in output:

-         for volume in output['runroot.log']:

-             log = session.downloadTaskOutput(task_id, 'runroot.log', volume=volume)

-             sys.stdout.write(log)

+     if not opts.quiet:

+         output = list_task_output_all_volumes(session, task_id)

+         if 'runroot.log' in output:

+             for volume in output['runroot.log']:

+                 log = session.downloadTaskOutput(task_id, 'runroot.log', volume=volume)

+                 sys.stdout.write(log)

      info = session.getTaskInfo(task_id)

      if info is None:

          sys.exit(1)

@@ -18,6 +18,7 @@ 

      def setUp(self):

          self.options = mock.MagicMock()

          self.options.debug = False

+         self.options.quiet = False

          self.session = mock.MagicMock()

          self.session.getAPIVersion.return_value = koji.API_VERSION

          self.args = [