From 076be762ec86a34b0d9911ed77487f9a539d8567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 3 May 2018 08:53:03 +0200 Subject: [PATCH] createrepo: Use less verbose logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is really no need to write out megabytes of logs that are not really interesting. This should also help the parallelization. With the verbose log createrepo fills the output buffer and needs to wait for the busy python program to read it first. Signed-off-by: Lubomír Sedlář --- pungi/wrappers/createrepo.py | 2 +- tests/test_createrepo_wrapper.py | 8 ++++---- tests/test_initphase.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pungi/wrappers/createrepo.py b/pungi/wrappers/createrepo.py index 4be6a9e4..f856afe1 100644 --- a/pungi/wrappers/createrepo.py +++ b/pungi/wrappers/createrepo.py @@ -36,7 +36,7 @@ class CreaterepoWrapper(object): oldpackagedirs=None, num_deltas=None, workers=None, use_xz=False): # groupfile = /path/to/comps.xml - cmd = [self.createrepo, directory, '--verbose'] + cmd = [self.createrepo, directory] if baseurl: cmd.append("--baseurl=%s" % baseurl) diff --git a/tests/test_createrepo_wrapper.py b/tests/test_createrepo_wrapper.py index 1b32b09c..d9d615f5 100644 --- a/tests/test_createrepo_wrapper.py +++ b/tests/test_createrepo_wrapper.py @@ -21,7 +21,7 @@ class CreateRepoWrapperTest(unittest.TestCase): cmd = repo.get_createrepo_cmd('/test/dir') self.assertEqual(cmd[:2], ['createrepo_c', '/test/dir']) - self.assertItemsEqual(cmd[2:], ['--verbose', '--update', '--database', '--unique-md-filenames']) + self.assertItemsEqual(cmd[2:], ['--update', '--database', '--unique-md-filenames']) def test_get_createrepo_c_cmd_full(self): repo = CreaterepoWrapper() @@ -44,7 +44,7 @@ class CreateRepoWrapperTest(unittest.TestCase): '--checksum=sha256', '--distro=Fedora', '--simple-md-filenames', '--no-database', '--content=c1', '--content=c2', '--repo=r1', '--repo=r2', '--revision=rev', '--deltas', '--oldpackagedirs=/test/old', '--num-deltas=2', '--workers=3', - '--outputdir=/test/output', '--verbose', '--xz']) + '--outputdir=/test/output', '--xz']) def test_get_createrepo_cmd_minimal(self): repo = CreaterepoWrapper(False) @@ -52,7 +52,7 @@ class CreateRepoWrapperTest(unittest.TestCase): self.assertEqual(cmd[:2], ['createrepo', '/test/dir']) self.assertItemsEqual(cmd[2:], ['--update', '--database', '--unique-md-filenames', - '--pretty', '--verbose']) + '--pretty']) def test_get_createrepo_cmd_full(self): repo = CreaterepoWrapper(False) @@ -74,4 +74,4 @@ class CreateRepoWrapperTest(unittest.TestCase): '--checksum=sha256', '--distro=Fedora', '--simple-md-filenames', '--no-database', '--content=c1', '--content=c2', '--repo=r1', '--repo=r2', '--revision=rev', '--deltas', '--oldpackagedirs=/test/old', '--num-deltas=2', '--workers=3', - '--outputdir=/test/output', '--verbose']) + '--outputdir=/test/output']) diff --git a/tests/test_initphase.py b/tests/test_initphase.py index 5451b872..1a3d10fe 100644 --- a/tests/test_initphase.py +++ b/tests/test_initphase.py @@ -139,7 +139,7 @@ class TestCreateCompsRepo(PungiTestCase): init.create_comps_repo(compose, 'x86_64', None) self.assertEqual(run.mock_calls, - [mock.call(['createrepo_c', self.topdir + '/work/x86_64/comps_repo', '--verbose', + [mock.call(['createrepo_c', self.topdir + '/work/x86_64/comps_repo', '--outputdir=%s/work/x86_64/comps_repo' % self.topdir, '--groupfile=%s/work/x86_64/comps/comps-x86_64.xml' % self.topdir, '--update', '--skip-stat', '--database', '--checksum=sha256',