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:
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:
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))
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)
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)
'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'):
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 '
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 '
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:
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