From c55ed742cd3290e4772a5f36fe62358e790fef64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Fri, 31 May 2019 09:31:01 +0200 Subject: [PATCH] Whitespace fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch fixes some issues with inconsistent use of whitespace. It only modifies lines that do not contain any code to not break git blame too much. Signed-off-by: Lubomír Sedlář --- pungi/checks.py | 1 + pungi/gather.py | 23 ++++++++++------------- tests/test_arch.py | 1 + tests/test_osbs_phase.py | 1 + tests/test_patch_iso.py | 1 + 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/pungi/checks.py b/pungi/checks.py index 521d71c6..8d4d579c 100644 --- a/pungi/checks.py +++ b/pungi/checks.py @@ -87,6 +87,7 @@ def is_genisoimage_needed(conf): def is_createrepo_c_needed(conf): return conf.get('createrepo_c', True) + # The first element in the tuple is package name expected to have the # executable (2nd element of the tuple). The last element is an optional # function that should determine if the tool is required based on diff --git a/pungi/gather.py b/pungi/gather.py index a2721534..544e2374 100644 --- a/pungi/gather.py +++ b/pungi/gather.py @@ -1435,34 +1435,32 @@ class Pungi(PungiBase): # setup the repoview call repoview = ['/usr/bin/repoview'] repoview.append('--quiet') - + repoview.append('--state-dir') repoview.append(os.path.join(cachedir, 'repoviewcache')) - + if repoviewtitle: repoview.append('--title') repoview.append(repoviewtitle) - + repoview.append(path) - + # run the command pungi.util._doRunCommand(repoview, self.logger) - + def doCreaterepo(self, comps=True): """Run createrepo to generate repodata in the tree.""" - - compsfile = None if comps: compsfile = os.path.join(self.workdir, '%s-%s-comps.xml' % (self.config.get('pungi', 'family'), self.config.get('pungi', 'version'))) - + # setup the cache dirs for target in ['createrepocache', 'repoviewcache']: pungi.util._ensuredir(os.path.join(self.config.get('pungi', 'cachedir'), target), self.logger, force=True) - + repoviewtitle = '%s %s - %s' % (self.config.get('pungi', 'family'), self.config.get('pungi', 'version'), self.tree_arch) @@ -1604,6 +1602,7 @@ class Pungi(PungiBase): # Create a function to use with os.path.walk to sum the files # basepath is used to make the sum output relative sums = [] + def getsum(basepath, dir, files): for file in files: path = os.path.join(dir, file) @@ -1616,7 +1615,7 @@ class Pungi(PungiBase): # Walk the os/images path to get sums of all the files os.path.walk(os.path.join(self.topdir, 'images'), getsum, self.topdir + '/') - + # Capture PPC images if self.tree_arch in ['ppc', 'ppc64', 'ppc64le']: os.path.walk(os.path.join(self.topdir, 'ppc'), getsum, self.topdir + '/') @@ -1690,8 +1689,6 @@ class Pungi(PungiBase): def doGetRelnotes(self): """Get extra files from packages in the tree to put in the topdir of the tree.""" - - docsdir = os.path.join(self.workdir, 'docs') relnoterpms = self.config.get('pungi', 'relnotepkgs').split() @@ -1748,7 +1745,7 @@ class Pungi(PungiBase): if regex.match(directory) and not os.path.exists(os.path.join(self.topdir, directory)): self.logger.info("Copying release note dir %s" % directory) shutil.copytree(os.path.join(dirpath, directory), os.path.join(self.topdir, directory)) - + def _doIsoChecksum(self, path, csumfile): """Simple function to wrap creating checksums of iso files.""" diff --git a/tests/test_arch.py b/tests/test_arch.py index 2ecfa4e8..f98b4555 100644 --- a/tests/test_arch.py +++ b/tests/test_arch.py @@ -93,5 +93,6 @@ class TestExclusiveExcludeArch(unittest.TestCase): self.assertEqual(log.mock_calls, [mock.call.debug("Excluding (EXCLUSIVEARCH: ['aarch64']): pkg.rpm")]) + if __name__ == "__main__": unittest.main() diff --git a/tests/test_osbs_phase.py b/tests/test_osbs_phase.py index 8670cf91..dd40ddaa 100644 --- a/tests/test_osbs_phase.py +++ b/tests/test_osbs_phase.py @@ -558,5 +558,6 @@ class OSBSThreadTest(helpers.PungiTestCase): self._assertCorrectMetadata(scratch=True) self._assertRepoFile() + if __name__ == '__main__': unittest.main() diff --git a/tests/test_patch_iso.py b/tests/test_patch_iso.py index b327d43a..dcd2a31b 100644 --- a/tests/test_patch_iso.py +++ b/tests/test_patch_iso.py @@ -65,6 +65,7 @@ class EqualsAny(object): def __repr__(self): return u'ANYTHING' + ANYTHING = EqualsAny()