From 4b53b6b1ce2c15b7f3ed5bedaee0e0026051a0f4 Mon Sep 17 00:00:00 2001 From: Alois Mahdal Date: Dec 13 2019 20:41:56 +0000 Subject: cli: Don't spam when downloading build copr-cli download build uses wget without any verbosity control, which generates roughly 10 lines per file. --no-verbose should suppress most of the verbosity while still reporting basics and errors. For example, my simple build 1128860 of single noarch rpm on 7 chroots, it will generate 1834 lines. (In my simple build pipeline, this means that the download just takes over the whole build log.) I've tested the option (injecting wget wrapper in path) on Fedora 30 and in my case the number of lines went down from 1834 to 182. --- diff --git a/cli/copr_cli/main.py b/cli/copr_cli/main.py index 35aa5f0..4f11a8c 100644 --- a/cli/copr_cli/main.py +++ b/cli/copr_cli/main.py @@ -481,7 +481,7 @@ class Commands(object): sys.stderr.write("No data for build id: {} and chroot: {}.\n".format(args.build_id, chroot.name)) continue - cmd = ['wget', '-r', '-nH', '--no-parent', '--reject', '"index.html*"', '-e', 'robots=off'] + cmd = ['wget', '-r', '-nH', '--no-parent', '--reject', '"index.html*"', '-e', 'robots=off', '--no-verbose'] cmd.extend(['-P', os.path.join(args.dest, chroot.name)]) cmd.extend(['--cut-dirs', str(base_len + 4)]) cmd.append(chroot.result_url) diff --git a/cli/tests/test_cli.py b/cli/tests/test_cli.py index 4852c6e..f53e837 100644 --- a/cli/tests/test_cli.py +++ b/cli/tests/test_cli.py @@ -289,12 +289,14 @@ def test_download_build(config_from_file, build_chroot_proxy_get_list, build_pro expected_sp_call_args = [ mock.call([ 'wget', '-r', '-nH', '--no-parent', '--reject', '"index.html*"', - '-e', 'robots=off', '-P', './epel-6-x86_64', '--cut-dirs', '6', + '-e', 'robots=off', '--no-verbose', '-P', './epel-6-x86_64', + '--cut-dirs', '6', 'http://example.com/results/epel-6-x86_64/python-copr-1.50-1.fc20' ]), mock.call([ 'wget', '-r', '-nH', '--no-parent', '--reject', '"index.html*"', - '-e', 'robots=off', '-P', './epel-6-i386', '--cut-dirs', '6', + '-e', 'robots=off', '--no-verbose', '-P', './epel-6-i386', + '--cut-dirs', '6', 'http://example.com/results/epel-6-i386/python-copr-1.50-1.fc20' ]) ] @@ -328,7 +330,8 @@ def test_download_build_select_chroot(config_from_file, build_chroot_proxy_get_l expected_sp_call_args = [ mock.call([ 'wget', '-r', '-nH', '--no-parent', '--reject', '"index.html*"', - '-e', 'robots=off', '-P', u'./epel-6-x86_64', '--cut-dirs', '6', + '-e', 'robots=off', '--no-verbose', '-P', u'./epel-6-x86_64', + '--cut-dirs', '6', 'http://example.com/results/epel-6-x86_64/python-copr-1.50-1.fc20' ]), ]