def report_skipped_packages(message, packages): """Generate report message about skipped packages""" title = 'Packages will not be installed' summary = '{} {}\n{}'.format(len(packages), message, '\n'.join(['- ' + p for p in packages])) reporting.report_generic(title=title, summary=summary, severity='high') if is_verbose(): api.show_message(summary)
def report_skipped_packages(message, packages): """Generate report message about skipped packages""" title = 'Packages will not be installed' summary = '{} {}\n{}'.format(len(packages), message, '\n'.join(['- ' + p for p in packages])) reporting.create_report([ reporting.Title(title), reporting.Summary(summary), reporting.Severity(reporting.Severity.HIGH), reporting.Tags([reporting.Tags.REPOSITORY]), ] + [reporting.RelatedResource('package', p) for p in packages]) if is_verbose(): api.show_message(summary)
def generate_report(packages): """ Generate a report if exists packages unsigned in the system """ if not packages: return unsigned_packages_new_line = '\n'.join(['- ' + p for p in packages]) unsigned_packages = ' '.join(packages) remediation = 'yum remove {}'.format(unsigned_packages) summary = 'The following packages have not been signed by Red Hat ' \ 'and may be removed in the upgrade process:\n{}'.format(unsigned_packages_new_line) reporting.report_with_remediation( title='Packages not signed by Red Hat found in the system', summary=summary, remediation=remediation, severity='high', ) if is_verbose(): api.show_message(summary)
def generate_report(packages): """ Generate a report if there are unsigned packages installed on the system """ if not packages: return unsigned_packages_new_line = '\n'.join(['- ' + p for p in packages]) title = 'Packages not signed by Red Hat found on the system' summary = ( 'The following packages have not been signed by Red Hat' ' and may be removed during the upgrade process in case Red Hat-signed' ' packages to be removed during the upgrade depend on them:\n{}'. format(unsigned_packages_new_line)) reporting.create_report([ reporting.Title(title), reporting.Summary(summary), reporting.Severity(reporting.Severity.HIGH), reporting.Tags(COMMON_REPORT_TAGS) ]) if is_verbose(): api.show_message(summary)
def generate_report(packages): """ Generate a report if exists packages unsigned in the system """ if not packages: return unsigned_packages_new_line = '\n'.join(['- ' + p for p in packages]) unsigned_packages = ' '.join(packages) remediation = ['yum', 'remove', '{}'.format(unsigned_packages)] title = 'Packages not signed by Red Hat found in the system' summary = 'The following packages have not been signed by Red Hat ' \ 'and may be removed in the upgrade process:\n{}'.format(unsigned_packages_new_line) reporting.create_report([ reporting.Title(title), reporting.Summary(summary), reporting.Severity(reporting.Severity.HIGH), reporting.Tags(COMMON_REPORT_TAGS), reporting.Remediation(commands=[remediation]), ] + [reporting.RelatedResource('package', p) for p in packages]) if is_verbose(): api.show_message(summary)