Check dependencies after config validation
This way the checks can rely on default values from the config. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
94ffa1c5c6
commit
80bd254347
@ -53,7 +53,7 @@ from . import util
|
|||||||
|
|
||||||
|
|
||||||
def is_jigdo_needed(conf):
|
def is_jigdo_needed(conf):
|
||||||
return conf.get("create_jigdo", False)
|
return conf.get("create_jigdo")
|
||||||
|
|
||||||
|
|
||||||
def is_isohybrid_needed(conf):
|
def is_isohybrid_needed(conf):
|
||||||
@ -93,7 +93,7 @@ def is_xorrisofs_needed(conf):
|
|||||||
|
|
||||||
|
|
||||||
def is_createrepo_c_needed(conf):
|
def is_createrepo_c_needed(conf):
|
||||||
return conf.get("createrepo_c", True)
|
return conf.get("createrepo_c")
|
||||||
|
|
||||||
|
|
||||||
# The first element in the tuple is package name expected to have the
|
# The first element in the tuple is package name expected to have the
|
||||||
|
@ -265,8 +265,6 @@ def main():
|
|||||||
# check if all requirements are met
|
# check if all requirements are met
|
||||||
import pungi.checks
|
import pungi.checks
|
||||||
|
|
||||||
if not pungi.checks.check(conf):
|
|
||||||
sys.exit(1)
|
|
||||||
pungi.checks.check_umask(logger)
|
pungi.checks.check_umask(logger)
|
||||||
if not pungi.checks.check_skip_phases(
|
if not pungi.checks.check_skip_phases(
|
||||||
logger, opts.skip_phase + conf.get("skip_phases", []), opts.just_phase
|
logger, opts.skip_phase + conf.get("skip_phases", []), opts.just_phase
|
||||||
@ -297,6 +295,9 @@ def main():
|
|||||||
fail_to_start("Config validation failed", errors=errors)
|
fail_to_start("Config validation failed", errors=errors)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
if not pungi.checks.check(conf):
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
if opts.target_dir:
|
if opts.target_dir:
|
||||||
compose_dir = Compose.get_compose_dir(
|
compose_dir = Compose.get_compose_dir(
|
||||||
opts.target_dir, conf, compose_type=compose_type, compose_label=opts.label
|
opts.target_dir, conf, compose_type=compose_type, compose_label=opts.label
|
||||||
|
@ -147,7 +147,7 @@ class CheckDependenciesTestCase(unittest.TestCase):
|
|||||||
with mock.patch("sys.stdout", new_callable=StringIO) as out:
|
with mock.patch("sys.stdout", new_callable=StringIO) as out:
|
||||||
with mock.patch("os.path.exists") as exists:
|
with mock.patch("os.path.exists") as exists:
|
||||||
exists.side_effect = self.dont_find(["/usr/bin/createrepo_c"])
|
exists.side_effect = self.dont_find(["/usr/bin/createrepo_c"])
|
||||||
result = checks.check({})
|
result = checks.check({"createrepo_c": True})
|
||||||
|
|
||||||
self.assertIn("createrepo_c", out.getvalue())
|
self.assertIn("createrepo_c", out.getvalue())
|
||||||
self.assertFalse(result)
|
self.assertFalse(result)
|
||||||
|
Loading…
Reference in New Issue
Block a user