Beispiel #1
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()
Beispiel #2
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()
Beispiel #3
0
    def install(cls, db, logger=None):
        if logger is None:
            logger = log.getChildLogger(cls.__name__)

        logger.info("Adding Fedora operating system")
        new = OpSys()
        new.name = cls.nice_name
        db.session.add(new)
        db.session.flush()
Beispiel #4
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()
Beispiel #5
0
Datei: rhel.py Projekt: 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()
Beispiel #6
0
 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))
Beispiel #7
0
 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))
Beispiel #8
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()
Beispiel #9
0
Datei: init.py Projekt: 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()
Beispiel #10
0
    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()
Beispiel #11
0
import re
import sys
import threading
from six.moves import range
from pyfaf.common import FafError, log
from pyfaf.queries import get_debug_files
from pyfaf.rpm import unpack_rpm_to_tmp
from pyfaf.utils.proc import safe_popen

# Instance of 'RootLogger' has no 'getChildLogger' member
# Invalid name "log" for type constant
# pylint: disable-msg=C0103,E1103
log = log.getChildLogger(__name__)
# pylint: enable-msg=C0103

RE_ADDR2LINE_LINE1 = re.compile(r"^([_0-9a-zA-Z\.~<>@:\*&,\)"
                                r"\( \[\]=]+|operator[^ ]+|\?\?)"
                                r"(\+0x[0-9a-f]+)?"
                                r"( inlined at ([^:]+):([0-9]+) in (.*))?$")

RE_UNSTRIP_BASE_OFFSET = re.compile(r"^((0x)?[0-9a-f]+)")

__all__ = [
    "IncompleteTask", "RetraceTaskPackage", "RetraceTask", "RetraceWorker",
    "addr2line", "demangle", "get_base_address", "ssource2funcname", "usrmove"
]


class IncompleteTask(FafError):
    pass
Beispiel #12
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
    }),