def __init__(self, conf, logger, latest=False): url = "https://koji.fedoraproject.org/kojihub" self.brew = xmlrpc.client.ServerProxy(url, allow_none=True) self.nvrs = [] self.buildinfo = {} self.conf = conf self.logger = logger if logger else u.setup_logger("koji") self.latest_by_nvr = latest
def _setup_logger(self, level=logging.INFO, user_logger=None): # If a logger has been provided, do not setup own if user_logger and isinstance(user_logger, logging.Logger): logger = user_logger else: logger = u.setup_logger("main", level) self.logger = logger return logger
def __init__(self, base_image, conf, rebuild_reason, logger): self.conf = conf self.base_image = base_image if not rebuild_reason: rebuild_reason = self.conf.rebuild_reason self.rebuild_reason = rebuild_reason.format(base_image=base_image) self.logger = logger if logger else u.setup_logger("dist-git") self.df_ext = self.conf.df_ext self.commit_msg = None
def _setup_logger(self, level=logging.INFO, user_logger=None, name=__name__): # If a logger is already set up, do not setup a new one if hasattr(self, "logger") and self.logger: return self.logger # If a logger has been provided, do not setup own if user_logger and isinstance(user_logger, logging.Logger): logger = user_logger else: logger = u.setup_logger(name, level) self.logger = logger return logger