Skip to content

Commit

Permalink
Use new leapp output apis
Browse files Browse the repository at this point in the history
Leapp introduced new output apis (and removed some other).
See oamg/leapp#840 for details.
  • Loading branch information
matejmatuska committed Aug 16, 2023
1 parent 34d4629 commit d317a29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions commands/preupgrade/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from leapp.logger import configure_logger
from leapp.utils.audit import Execution
from leapp.utils.clicmd import command, command_opt
from leapp.utils.output import beautify_actor_exception, report_errors, report_info, report_inhibitors
from leapp.utils.output import beautify_actor_exception, report_errors, report_info


@command('preupgrade', help='Generate preupgrade report')
Expand Down Expand Up @@ -77,10 +77,9 @@ def preupgrade(args, breadcrumbs):
workflow.save_answers(answerfile_path, userchoices_path)
util.generate_report_files(context, report_schema)
report_errors(workflow.errors)
report_inhibitors(context)
report_files = util.get_cfg_files('report', cfg)
log_files = util.get_cfg_files('logs', cfg)
report_info(context, report_files, log_files, answerfile_path, fail=workflow.failure)
report_info(context, report_files, log_files, answerfile_path, fail=workflow.failure, errors=workflow.errors)

if workflow.failure:
sys.exit(1)
Expand Down
5 changes: 2 additions & 3 deletions commands/upgrade/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from leapp.logger import configure_logger
from leapp.utils.audit import Execution
from leapp.utils.clicmd import command, command_opt
from leapp.utils.output import beautify_actor_exception, report_errors, report_info, report_inhibitors
from leapp.utils.output import beautify_actor_exception, report_errors, report_info

# NOTE:
# If you are adding new parameters please ensure that they are set in the upgrade function invocation in `rerun`
Expand Down Expand Up @@ -106,11 +106,10 @@ def upgrade(args, breadcrumbs):
logger.info("Answerfile will be created at %s", answerfile_path)
workflow.save_answers(answerfile_path, userchoices_path)
report_errors(workflow.errors)
report_inhibitors(context)
util.generate_report_files(context, report_schema)
report_files = util.get_cfg_files('report', cfg)
log_files = util.get_cfg_files('logs', cfg)
report_info(context, report_files, log_files, answerfile_path, fail=workflow.failure)
report_info(context, report_files, log_files, answerfile_path, fail=workflow.failure, errors=workflow.errors)

if workflow.failure:
sys.exit(1)
Expand Down

0 comments on commit d317a29

Please sign in to comment.