cosmetic: give log string arguments as function parameters
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 5 Dec 2013 13:51:35 +0000 (15:51 +0200)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Mon, 9 Dec 2013 15:06:35 +0000 (17:06 +0200)
Change-Id: Ib4975532931850964804e2763f945b8ca3ae110e
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
gbp_repocache/__init__.py
obs_service_gbp/command.py

index dab22809f385ac8a15441b31570da4cfec53d250..fd7aa5467019b7988b97a4ba83d23b187ff34e9c 100644 (file)
@@ -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)
index 27c1667ec0be011ef5317485e9ff45b1cd4a982e..895811de4f679f844f9985a8dd749f0b27116a14 100644 (file)
@@ -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