Remove deprecated warn() call
Instead warning() should be called. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
116c617b86
commit
4c6396f491
@ -628,9 +628,8 @@ class Pungi(PungiBase):
|
|||||||
deps = self.ayum.whatProvides(r, f, v).returnPackages()
|
deps = self.ayum.whatProvides(r, f, v).returnPackages()
|
||||||
deps = self.excludePackages(deps)
|
deps = self.excludePackages(deps)
|
||||||
if not deps:
|
if not deps:
|
||||||
self.logger.warn(
|
self.logger.warning(
|
||||||
"Unresolvable dependency %s in %s.%s"
|
"Unresolvable dependency %s in %s.%s", Req(req), po.name, po.arch
|
||||||
% (Req(req), po.name, po.arch)
|
|
||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@ -670,7 +669,13 @@ class Pungi(PungiBase):
|
|||||||
added.add(dep)
|
added.add(dep)
|
||||||
|
|
||||||
except (yum.Errors.InstallError, yum.Errors.YumBaseError) as ex:
|
except (yum.Errors.InstallError, yum.Errors.YumBaseError) as ex:
|
||||||
self.logger.warn("Unresolvable dependency %s in %s.%s (repo: %s)" % (r, po.name, po.arch, po.repoid))
|
self.logger.warning(
|
||||||
|
"Unresolvable dependency %s in %s.%s (repo: %s)",
|
||||||
|
r,
|
||||||
|
po.name,
|
||||||
|
po.arch,
|
||||||
|
po.repoid,
|
||||||
|
)
|
||||||
continue
|
continue
|
||||||
self.resolved_deps[req] = None
|
self.resolved_deps[req] = None
|
||||||
|
|
||||||
@ -920,7 +925,9 @@ class Pungi(PungiBase):
|
|||||||
matches = [ po for po in matches if po.arch in self.valid_multilib_arches ]
|
matches = [ po for po in matches if po.arch in self.valid_multilib_arches ]
|
||||||
|
|
||||||
if not matches:
|
if not matches:
|
||||||
self.logger.warn('Could not find a match for %s in any configured repo' % pattern)
|
self.logger.warning(
|
||||||
|
"Could not find a match for %s in any configured repo", pattern
|
||||||
|
)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
packages_by_name = {}
|
packages_by_name = {}
|
||||||
|
@ -368,7 +368,9 @@ class Gather(GatherBase):
|
|||||||
self.finished_get_package_deps_reqs[str(req)].update(deps)
|
self.finished_get_package_deps_reqs[str(req)].update(deps)
|
||||||
result.update((dep, req) for dep in deps)
|
result.update((dep, req) for dep in deps)
|
||||||
else:
|
else:
|
||||||
self.logger.warn("Unresolvable dependency %s in %s.%s" % (req, pkg.name, pkg.arch))
|
self.logger.warning(
|
||||||
|
"Unresolvable dependency %s in %s.%s", req, pkg.name, pkg.arch
|
||||||
|
)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@ -508,7 +510,7 @@ class Gather(GatherBase):
|
|||||||
if pkgs:
|
if pkgs:
|
||||||
added.update(pkgs)
|
added.update(pkgs)
|
||||||
else:
|
else:
|
||||||
self.logger.warn("Prepopulate: Doesn't match: %s" % name_arch)
|
self.logger.warning("Prepopulate: Doesn't match: %s", name_arch)
|
||||||
|
|
||||||
for pkg in added:
|
for pkg in added:
|
||||||
self._set_flag(pkg, PkgFlag.prepopulate)
|
self._set_flag(pkg, PkgFlag.prepopulate)
|
||||||
|
@ -88,8 +88,9 @@ class CreateisoPhase(PhaseLoggerMixin, PhaseBase):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if not self._find_rpms(os_tree):
|
if not self._find_rpms(os_tree):
|
||||||
self.logger.warn("No RPMs found for %s.%s, skipping ISO"
|
self.logger.warning(
|
||||||
% (variant.uid, arch))
|
"No RPMs found for %s.%s, skipping ISO" % (variant.uid, arch)
|
||||||
|
)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
bootable = self._is_bootable(variant, arch)
|
bootable = self._is_bootable(variant, arch)
|
||||||
@ -112,7 +113,9 @@ class CreateisoPhase(PhaseLoggerMixin, PhaseBase):
|
|||||||
iso_path = self.compose.paths.compose.iso_path(
|
iso_path = self.compose.paths.compose.iso_path(
|
||||||
arch, variant, filename, symlink_to=symlink_isos_to)
|
arch, variant, filename, symlink_to=symlink_isos_to)
|
||||||
if os.path.isfile(iso_path):
|
if os.path.isfile(iso_path):
|
||||||
self.logger.warn("Skipping mkisofs, image already exists: %s" % iso_path)
|
self.logger.warning(
|
||||||
|
"Skipping mkisofs, image already exists: %s", iso_path
|
||||||
|
)
|
||||||
continue
|
continue
|
||||||
deliverables.append(iso_path)
|
deliverables.append(iso_path)
|
||||||
|
|
||||||
@ -369,11 +372,10 @@ def split_iso(compose, arch, variant, no_split=False, logger=None):
|
|||||||
logger.debug('Splitting media for %s.%s:' % (variant.uid, arch))
|
logger.debug('Splitting media for %s.%s:' % (variant.uid, arch))
|
||||||
result = ms.split()
|
result = ms.split()
|
||||||
if no_split and result[0]['size'] > split_size:
|
if no_split and result[0]['size'] > split_size:
|
||||||
logger.warn('ISO for %s.%s does not fit on single media! '
|
logger.warning(
|
||||||
'It is %s bytes too big. (Total size: %s B)'
|
"ISO for %s.%s does not fit on single media! It is %s bytes too big. (Total size: %s B)"
|
||||||
% (variant.uid, arch,
|
% (variant.uid, arch, result[0]['size'] - split_size, result[0]['size'])
|
||||||
result[0]['size'] - split_size,
|
)
|
||||||
result[0]['size']))
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ class CreateisoPhaseTest(helpers.PungiTestCase):
|
|||||||
self.assertEqual(pool.queue_put.call_args_list, [])
|
self.assertEqual(pool.queue_put.call_args_list, [])
|
||||||
six.assertCountEqual(
|
six.assertCountEqual(
|
||||||
self,
|
self,
|
||||||
phase.logger.warn.call_args_list,
|
phase.logger.warning.call_args_list,
|
||||||
[mock.call('No RPMs found for Everything.x86_64, skipping ISO'),
|
[mock.call('No RPMs found for Everything.x86_64, skipping ISO'),
|
||||||
mock.call('No RPMs found for Everything.amd64, skipping ISO'),
|
mock.call('No RPMs found for Everything.amd64, skipping ISO'),
|
||||||
mock.call('No RPMs found for Everything.src, skipping ISO'),
|
mock.call('No RPMs found for Everything.src, skipping ISO'),
|
||||||
@ -838,7 +838,7 @@ class SplitIsoTest(helpers.PungiTestCase):
|
|||||||
os.path.join(base_path, 'Packages/b/bash.rpm')],
|
os.path.join(base_path, 'Packages/b/bash.rpm')],
|
||||||
'size': 5400166400}])
|
'size': 5400166400}])
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
compose._logger.warn.call_args_list,
|
compose._logger.warning.call_args_list,
|
||||||
[mock.call('ISO for Server.x86_64 does not fit on single media! '
|
[mock.call('ISO for Server.x86_64 does not fit on single media! '
|
||||||
'It is 710652160 bytes too big. (Total size: 5400166400 B)')]
|
'It is 710652160 bytes too big. (Total size: 5400166400 B)')]
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user