Silence config warnings in quiet mode

It's a bit unfortunate we can't use the logger for printing these, but
there is cyclic dependency: to set up logger, we need Compose object (to
generate path to log file), but to create Compose object we need a valid
config.

JIRA: COMPOSE-2577
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2018-05-28 13:38:19 +02:00
parent 92b5ad2e05
commit 49e8aa0c7e
1 changed files with 3 additions and 2 deletions

View File

@ -229,8 +229,9 @@ def main():
sys.exit(1)
pungi.checks.check_umask(logger)
errors, warnings = pungi.checks.validate(conf)
for warning in warnings:
print(warning, file=sys.stderr)
if not opts.quiet:
for warning in warnings:
print(warning, file=sys.stderr)
if errors:
for error in errors:
print(error, file=sys.stderr)