Esempio n. 1
0
    def install(cls, db, logger=None):
        if logger is None:
            logger = log.getChildLogger(cls.__name__)

        logger.info("Adding CentOS")
        new = OpSys()
        new.name = cls.nice_name
        db.session.add(new)
        db.session.flush()
Esempio n. 2
0
    def install(cls, db, logger=None):
        if logger is None:
            logger = log.getChildLogger(cls.__name__)

        logger.info("Adding bugtracker '{0}'".format(cls.name))
        new = Bugtracker()
        new.name = cls.name
        db.session.add(new)
        db.session.flush()
Esempio n. 3
0
File: rhel.py Progetto: trams/faf
    def install(cls, db, logger=None):
        if logger is None:
            logger = log.getChildLogger(cls.__name__)

        logger.info("Adding Red Hat Enterprise Linux operating system")
        new = OpSys()
        new.name = cls.nice_name
        db.session.add(new)
        db.session.flush()
Esempio n. 4
0
File: retrace.py Progetto: abrt/faf
 def __init__(self, worker_id, inqueue, outqueue):
     name = "Worker #{0}".format(worker_id)
     super(RetraceWorker, self).__init__(name=name)
     self.inqueue = inqueue
     self.outqueue = outqueue
     self.stop = False
     # Instance of 'RootLogger' has no 'getChildLogger' member
     # pylint: disable-msg=E1103
     self.log = log.getChildLogger("{0}.{1}".format(self.__class__.__name__,
                                                    self.name))
Esempio n. 5
0
    def install(cls, db, logger=None):
        if logger is None:
            logger = log.getChildLogger(cls.__name__)

        for flag, (char, nice_name) in cls.tainted_flags.items():
            if get_taint_flag_by_ureport_name(db, flag) is None:
                logger.info("Adding kernel taint flag '{0}': {1}"
                            .format(char, nice_name))

                new = KernelTaintFlag()
                new.character = char
                new.ureport_name = flag
                new.nice_name = nice_name
                db.session.add(new)

        db.session.flush()
Esempio n. 6
0
File: init.py Progetto: abrt/faf
    def run(self, cmdline, db):
        for arch in Init.archs:
            db_arch = get_arch_by_name(db, arch)
            if db_arch is not None:
                continue

            self.log_info("Adding architecture '{0}'".format(arch))
            new = Arch()
            new.name = arch
            db.session.add(new)

        db.session.flush()

        plugins = set()
        for cls in Plugin.__subclasses__():
            plugins |= set(cls.__subclasses__())

        for plugin in plugins:
            if not plugin.installed(db):
                plugin.install(db, logger=log.getChildLogger(plugin.__name__))

        db.session.flush()
Esempio n. 7
0
                           ReportArch,
                           ReportComment,
                           ReportContactEmail,
                           ReportHash,
                           ReportHistoryDaily,
                           ReportHistoryMonthly,
                           ReportHistoryWeekly,
                           ReportOpSysRelease,
                           ReportMantis,
                           ReportReason,
                           ReportURL,
                           column_len)
from pyfaf.ureport_compat import ureport1to2
from sqlalchemy.exc import IntegrityError

log = log.getChildLogger(__name__)

__all__ = ["get_version", "save", "ureport2",
           "validate", "validate_attachment"]


UREPORT_CHECKER = DictChecker({
    "os":              DictChecker({
        "name":            StringChecker(allowed=systems.keys()),
        "version":         StringChecker(pattern=r"^[a-zA-Z0-9_\.\-\+~]+$",
                                         maxlen=column_len(OpSysRelease,
                                                           "version")),
        "architecture":    StringChecker(pattern=r"^[a-zA-Z0-9_]+$",
                                         maxlen=column_len(Arch, "name")),
        # Anything else will be checked by the plugin
    }),