Exemple #1
0
    def run(self):
        format = self.get_option('format')
        report = self.api.report(convert_to_mime_type(format, 'text'))

        if format == 'pdf':
            save_report(report[0], attachment_file_name(report[1], 'katello_users_report.pdf'))
        else:
            print report[0]

        return os.EX_OK
Exemple #2
0
    def run(self):
        orgId = self.get_option("org")
        envName = self.get_option("environment")
        format_in = self.get_option("format")

        if envName is None:
            report = self.api.report_by_org(orgId, convert_to_mime_type(format_in, "text"))
        else:
            environment = get_environment(orgId, envName)
            report = self.api.report_by_env(environment["id"], convert_to_mime_type(format_in, "text"))

        if format_in == "pdf":
            save_report(report[0], attachment_file_name(report[1], "%s_systems_report.pdf" % get_katello_mode()))
        else:
            print report[0]

        return os.EX_OK
Exemple #3
0
    def run(self):
        orgId = self.get_option('org')
        envName = self.get_option('environment')
        format = self.get_option('format')

        if envName is None:
            report = self.api.report_by_org(orgId, convert_to_mime_type(format, 'text'))
        else:
            environment = get_environment(orgId, envName)
            report = self.api.report_by_env(environment['id'], convert_to_mime_type(format, 'text'))

        if format == 'pdf':
            save_report(report[0], attachment_file_name(report[1], 'katello_systems_report.pdf'))
        else:
            print report[0]

        return os.EX_OK
Exemple #4
0
    def run(self):
        orgId = self.get_option('org')
        envName = self.get_option('environment')
        format = self.get_option('format')

        if envName is None:
            report = self.api.report_by_org(
                orgId, convert_to_mime_type(format, 'text'))
        else:
            environment = get_environment(orgId, envName)
            report = self.api.report_by_env(
                environment['id'], convert_to_mime_type(format, 'text'))

        if format == 'pdf':
            save_report(
                report[0],
                attachment_file_name(report[1], 'katello_systems_report.pdf'))
        else:
            print report[0]

        return os.EX_OK