Exemple #1
0
    def process(self):
        results = [msg for msg in self.consume(CheckResult)]
        errors = [msg for msg in results if msg.severity == 'Error']

        report_file = '/tmp/leapp-report.txt'
        error = report.generate_report(results, report_file)
        if error:
            self.report_error('Report Error: ' + error)
        else:
            self.log.info('Generated report at ' + report_file)

        if errors:
            for e in errors:
                self.report_error('%s: %s: %s' %
                                  (e.severity, e.result, e.summary))

            self.report_error(
                'Ending process due to errors found during checks')
Exemple #2
0
    def process(self):
        results = list(self.consume(Report))
        inhibitors = [msg for msg in results if 'inhibitor' in msg.flags]
        high_sev_msgs = [
            msg for msg in results
            if msg.severity == 'high' and 'inhibitor' not in msg.flags
        ]
        msgs_to_report = inhibitors + high_sev_msgs

        report_file = '/var/log/leapp/leapp-report.txt'
        error = report.generate_report(msgs_to_report, report_file)
        if error:
            self.report_error('Report Error: ' + error)
        else:
            self.log.info('Generated report at ' + report_file)

        if inhibitors:
            for e in inhibitors:
                self.report_error(e.title)

            self.report_error(
                'Ending process due to errors found during checks, see {} for detailed report.'
                .format(report_file))