def install(cls, db, logger=None) -> None: if logger is None: logger = log.getChild(cls.__name__) logger.info("Adding bugtracker '{0}'".format(cls.name)) new = Bugtracker() new.name = cls.name db.session.add(new) db.session.flush()
def install(cls, db, logger=None): if logger is None: logger = log.getChild(cls.__name__) logger.info("Adding Fedora operating system") new = OpSys() new.name = cls.nice_name db.session.add(new) db.session.flush()
def install(cls, db, logger=None) -> None: if logger is None: logger = log.getChild(cls.__name__) logger.info("Adding CentOS") new = OpSys() new.name = cls.nice_name db.session.add(new) db.session.flush()
def install(cls, db, logger=None) -> None: if logger is None: logger = log.getChild(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()
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.getChild(plugin.__name__)) db.session.flush()
import re from concurrent import futures from pyfaf.common import FafError, log, thread_logger from pyfaf.queries import get_debug_files from pyfaf.faf_rpm import unpack_rpm_to_tmp from pyfaf.utils.proc import safe_popen # Instance of 'RootLogger' has no 'getChild' member # Invalid name "log" for type constant # pylint: disable-msg=C0103,E1103 log = log.getChild(__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", "RetracePool", "addr2line", "demangle", "get_base_address", "ssource2funcname", "usrmove" ] class IncompleteTask(FafError): pass
from pyfaf.config import config from pyfaf.utils.parse import str2bool notify_reports = str2bool(config.get("fedmsg.realtime_reports", "false")) notify_problems = str2bool(config.get("fedmsg.realtime_problems", "false")) # pylint: disable=ungrouped-imports if notify_reports or notify_problems: from sqlalchemy import event from fedora_messaging.api import publish from fedora_messaging.exceptions import ConnectionException, PublishReturned from . import Report from faf_schema.schema import FafReportMessage, FafProblemMessage from pyfaf.utils import web from pyfaf.common import log logger = log.getChild(__name__) levels = tuple(10**n for n in range(7)) @event.listens_for(Report.count, "set") def fedmsg_report(target, value, oldvalue, initiator) -> None: # pylint: disable=unused-argument """ Send Fedora Messaging notifications when Report.count reaches specified threshold. """ try: db_report = target if notify_reports: oldcount = oldvalue newcount = value for level in levels: if oldcount < level <= newcount: