From: Markus Lehtonen Date: Thu, 5 Dec 2013 13:51:35 +0000 (+0200) Subject: cosmetic: give log string arguments as function parameters X-Git-Tag: submit/devel/20190730.075437~62 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=62be9cb6e96b76c4239e5207a04fbc2a885ffda0;p=services%2Fobs-service-git-buildpackage.git cosmetic: give log string arguments as function parameters Change-Id: Ib4975532931850964804e2763f945b8ca3ae110e Signed-off-by: Markus Lehtonen --- diff --git a/gbp_repocache/__init__.py b/gbp_repocache/__init__.py index dab2280..fd7aa54 100644 --- a/gbp_repocache/__init__.py +++ b/gbp_repocache/__init__.py @@ -104,10 +104,10 @@ class CachedRepo(object): def _init_cache_dir(self): """Check and initialize repository cache base directory""" - LOGGER.debug("Using cache basedir '%s'" % self.basedir) + LOGGER.debug("Using cache basedir '%s'", self.basedir) _subdir = os.path.dirname(self.repodir) if not os.path.exists(_subdir): - LOGGER.debug('Creating missing cache subdir %s' % _subdir) + LOGGER.debug('Creating missing cache subdir %s', _subdir) try: os.makedirs(_subdir) except OSError as err: @@ -116,7 +116,7 @@ class CachedRepo(object): def _acquire_lock(self, repodir): """Acquire the repository lock""" - LOGGER.debug("Acquiring repository lock for %s" % repodir) + LOGGER.debug("Acquiring repository lock for %s", repodir) try: self.lock = open(repodir + '.lock', 'w') except IOError as err: @@ -154,7 +154,7 @@ class CachedRepo(object): def _init_git_repo(self, url, bare): """Clone / update a remote git repository""" - LOGGER.debug('Caching %s in %s' % (url, self.repodir)) + LOGGER.debug('Caching %s in %s', url, self.repodir) # Create subdir, if it doesn't exist if not os.path.exists(os.path.dirname(self.repodir)): os.makedirs(os.path.dirname(self.repodir)) @@ -167,7 +167,7 @@ class CachedRepo(object): except GitRepositoryError: pass if not self.repo or self.repo.bare != bare: - LOGGER.info('Removing corrupted repo cache %s' % self.repodir) + LOGGER.info('Removing corrupted repo cache %s', self.repodir) try: self.repo = None shutil.rmtree(self.repodir) @@ -182,7 +182,7 @@ class CachedRepo(object): raise CachedRepoError('Failed to fetch from remote: %s' % err) if not self.repo: - LOGGER.info('Cloning from %s' % url) + LOGGER.info('Cloning from %s', url) try: self.repo = MirrorGitRepository.clone(self.repodir, url, bare=bare) diff --git a/obs_service_gbp/command.py b/obs_service_gbp/command.py index 27c1667..895811d 100644 --- a/obs_service_gbp/command.py +++ b/obs_service_gbp/command.py @@ -79,10 +79,10 @@ def read_config(filenames): 'gbp-group': None} filenames = [os.path.expanduser(fname) for fname in filenames] - LOGGER.debug('Trying %s config files: %s' % (len(filenames), filenames)) + LOGGER.debug('Trying %s config files: %s', len(filenames), filenames) parser = SafeConfigParser(defaults=defaults) read = parser.read(filenames) - LOGGER.debug('Read %s config files: %s' % (len(read), read)) + LOGGER.debug('Read %s config files: %s', len(read), read) # Add our one-and-only section, if it does not exist if not parser.has_section('general'): @@ -124,7 +124,7 @@ def gbp_export(repo, args, config): specs_found = have_spec('.') if args.rpm == 'yes' or (args.rpm == 'auto' and specs_found): LOGGER.info('Exporting RPM packaging files with GBP') - LOGGER.debug('git-buildpackage-rpm args: %s' % ' '.join(rpm_args)) + LOGGER.debug('git-buildpackage-rpm args: %s', ' '.join(rpm_args)) ret = fork_call(uid, gid, gbp_rpm, rpm_args) if ret: LOGGER.error('Git-buildpackage-rpm failed, unable to export ' @@ -132,7 +132,7 @@ def gbp_export(repo, args, config): return 2 if args.deb == 'yes' or (args.deb== 'auto' and os.path.isdir('debian')): LOGGER.info('Exporting Debian source package with GBP') - LOGGER.debug('git-buildpackage args: %s' % ' '.join(deb_args)) + LOGGER.debug('git-buildpackage args: %s', ' '.join(deb_args)) ret = fork_call(uid, gid, gbp_deb, deb_args) if ret: LOGGER.error('Git-buildpackage failed, unable to export Debian ' @@ -142,7 +142,7 @@ def gbp_export(repo, args, config): shutil.move(os.path.join(tmp_out, fname), os.path.join(args.outdir, fname)) except GbpServiceError as err: - LOGGER.error('Internal service error when trying to run GBP: %s' % err) + LOGGER.error('Internal service error when trying to run GBP: %s', err) LOGGER.error('This is most likely a configuration error (or a BUG)!') return 1 finally: @@ -192,7 +192,7 @@ def main(argv=None): repo = CachedRepo(config['repo-cache-dir'], args.url) args.revision = repo.update_working_copy(args.revision) except CachedRepoError as err: - LOGGER.error('RepoCache: %s' % str(err)) + LOGGER.error('RepoCache: %s', str(err)) return 1 # Run GBP