def __init__(self, channels, nickname, password, server, port=6667, server_password=None): super(RecheckWatchBot, self).__init__( [(server, port, server_password)], nickname, nickname) self.channel_list = channels self.nickname = nickname self.password = password self.log = logging.getLogger('recheckwatchbot')
def __init__(self, channels, config): super(RecheckWatchBot, self).__init__( [(config.ircbot_server, config.ircbot_port, config.ircbot_server_password)], config.ircbot_nick, config.ircbot_nick) self.channel_list = channels self.nickname = config.ircbot_nick self.password = config.ircbot_pass self.log = logging.getLogger('recheckwatchbot')
def __init__(self, ircbot, channel_config, msgs, username, queries, host, key, commenting=True): super(RecheckWatch, self).__init__() self.ircbot = ircbot self.channel_config = channel_config self.msgs = msgs self.log = logging.getLogger('recheckwatchbot') self.username = username self.queries = queries self.host = host self.connected = False self.commenting = commenting self.key = key self.lp = launchpad.Launchpad.login_anonymously('grabbing bugs', 'production', LPCACHEDIR, timeout=60)
def __init__(self, ircbot, channel_config, msgs, config=None, commenting=True): super(RecheckWatch, self).__init__() self.config = config or er_conf.Config() self.ircbot = ircbot self.channel_config = channel_config self.msgs = msgs self.log = logging.getLogger('recheckwatchbot') self.username = config.gerrit_user self.queries = config.gerrit_query_file self.host = config.gerrit_host self.connected = False self.commenting = commenting self.key = config.gerrit_host_key self.lp = launchpad.Launchpad.login_anonymously('grabbing bugs', 'production', LPCACHEDIR, timeout=60)
def __init__(self, ircbot, channel_config, msgs, username, queries, host, key, commenting=True, es_url=None, db_uri=None): super(RecheckWatch, self).__init__() self.ircbot = ircbot self.channel_config = channel_config self.msgs = msgs self.log = logging.getLogger('recheckwatchbot') self.username = username self.queries = queries self.host = host self.connected = False self.commenting = commenting self.key = key self.lp = launchpad.Launchpad.login_anonymously('grabbing bugs', 'production', LPCACHEDIR, timeout=60) self.es_url = es_url self.db_uri = db_uri
import os from launchpadlib import launchpad import pytz import requests import elastic_recheck.elasticRecheck as er from elastic_recheck import log as logging import elastic_recheck.query_builder as qb import elastic_recheck.results as er_results STEP = 3600000 LPCACHEDIR = os.path.expanduser('~/.launchpadlib/cache') LOG = logging.getLogger('ergraph') def get_launchpad_bug(bug): lp = launchpad.Launchpad.login_anonymously('grabbing bugs', 'production', LPCACHEDIR) try: lp_bug = lp.bugs[bug] bugdata = {'name': lp_bug.title} projects = ", ".join( map(lambda x: "(%s - %s)" % (x.bug_target_name, x.status), lp_bug.bug_tasks)) bugdata['affects'] = projects bugdata['reviews'] = get_open_reviews(bug) except KeyError: # if someone makes a bug private, we lose access to it.
import urllib3 from urllib3.exceptions import InsecurePlatformWarning urllib3.disable_warnings(InsecurePlatformWarning) import elastic_recheck.config as er_conf import elastic_recheck.elasticRecheck as er from elastic_recheck import log as logging import elastic_recheck.query_builder as qb import elastic_recheck.results as er_results STEP = 3600000 LPCACHEDIR = os.path.expanduser('~/.launchpadlib/cache') LOG = logging.getLogger('ergraph') def get_launchpad_bug(bug): try: lp = launchpad.Launchpad.login_anonymously('grabbing bugs', 'production', LPCACHEDIR) lp_bug = lp.bugs[bug] bugdata = {'name': lp_bug.title} projects = ", ".join(map(lambda x: "(%s - %s)" % (x.bug_target_name, x.status), lp_bug.bug_tasks)) bugdata['affects'] = projects bugdata['reviews'] = get_open_reviews(bug) except KeyError:
# License for the specific language governing permissions and limitations # under the License. import argparse import base64 import itertools import json import time import requests import yaml from elastic_recheck import log as logging LOG = logging.getLogger('erquery') ENDPOINT = 'http://logstash.openstack.org/api' DEFAULT_NUMBER_OF_DAYS = 10 DEFAULT_MAX_QUANTITY = 5 IGNORED_ATTRIBUTES = [ 'build_master', 'build_patchset', 'build_ref', 'build_short_uuid', 'build_uuid', 'error_pr', 'host', 'received_at', 'type', ]