Fix warning about productimg in skip_phases option

If phase is skipped in a config option (and not on command line), we
should just print a warning or do nothing in quiet mode.

JIRA: RHELCMP-399
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2020-04-27 15:47:49 +02:00 committed by lsedlar
parent 0525768519
commit 9a1b9dd154
2 changed files with 2 additions and 2 deletions

View File

@ -780,7 +780,7 @@ def make_schema():
"paths_module": {"type": "string"}, "paths_module": {"type": "string"},
"skip_phases": { "skip_phases": {
"type": "array", "type": "array",
"items": {"type": "string", "enum": PHASES_NAMES}, "items": {"type": "string", "enum": PHASES_NAMES + ["productimg"]},
"default": [], "default": [],
}, },
"image_name_format": { "image_name_format": {

View File

@ -249,7 +249,7 @@ def main():
if not opts.quiet: if not opts.quiet:
# TODO: workaround for config files containing skip_phase = productimg # TODO: workaround for config files containing skip_phase = productimg
# Remove when all config files are up to date # Remove when all config files are up to date
if "productimg" in opts.skip_phase or "productimg" in opts.just_phase: if "productimg" in opts.skip_phase + opts.just_phase + conf["skip_phases"]:
print( print(
"WARNING: productimg phase has been removed, please remove it from " "WARNING: productimg phase has been removed, please remove it from "
"--skip-phase or --just-phase option", "--skip-phase or --just-phase option",