Beispiel #1
0
def log(repo, modified_since):
    module = repo['module']
    LOG.debug('Retrieving list of bugs for module: %s', module)

    if not launchpad_utils.lp_module_exists(module):
        LOG.debug('Module %s does not exist at Launchpad', module)
        return

    for record_draft in launchpad_utils.lp_bug_generator(module,
                                                         modified_since):

        # record_draft can be a bug or bug target and
        # in the latter case it can be from a different module
        bug_target = record_draft['bug_target_name'].split('/')
        target_module = bug_target[0]
        if target_module != module:
            continue  # ignore foreigners

        record = {}

        if len(bug_target) == 2:
            record['release'] = bug_target[1]  # treat target as release

        for field in LINK_FIELDS:
            link = record_draft[field + '_link']
            if link:
                record[field] = launchpad_utils.link_to_launchpad_id(link)

        for field in BUG_FIELDS:
            record[field] = record_draft[field]

        for field in DATE_FIELDS:
            date = record_draft[field]
            if date:
                record[field] = utils.iso8601_to_timestamp(date)

        bug_id = _get_bug_id(record_draft['web_link'])
        record['module'] = module
        record['id'] = utils.make_bug_id(bug_id, module, record.get('release'))

        LOG.debug('New bug: %s', record)
        yield record
Beispiel #2
0
def _log_module(module, primary_module, modified_since):
    for record_draft in launchpad_utils.lp_bug_generator(
            module, modified_since):

        # record_draft can be a bug or bug target and
        # in the latter case it can be from a different module
        bug_target = record_draft['bug_target_name'].split('/')
        target_module = bug_target[0]
        if target_module != module:
            continue  # ignore foreigners

        record = {}

        if len(bug_target) == 2:
            record['release'] = bug_target[1]  # treat target as release

        for field in LINK_FIELDS:
            link = record_draft[field + '_link']
            if link:
                record[field] = launchpad_utils.link_to_launchpad_id(link)

        for field in BUG_FIELDS:
            record[field] = record_draft[field]

        for field in DATE_FIELDS:
            date = record_draft[field]
            if date:
                record[field] = utils.iso8601_to_timestamp(date)

        bug_id = _get_bug_id(record_draft['web_link'])
        record['module'] = primary_module
        record['id'] = utils.make_bug_id(bug_id, primary_module,
                                         record.get('release'))

        LOG.debug('New bug: %s', record)
        yield record
Beispiel #3
0
def _log_module(module, primary_module, modified_since):
    for record_draft in launchpad_utils.lp_bug_generator(module,
                                                         modified_since):

        # record_draft can be a bug or bug target and
        # in the latter case it can be from a different module
        bug_target = record_draft['bug_target_name'].split('/')
        target_module = bug_target[0]
        if target_module != module:
            continue  # ignore foreigners

        record = {}

        if len(bug_target) == 2:
            record['release'] = bug_target[1]  # treat target as release

        for field in LINK_FIELDS:
            link = record_draft[field + '_link']
            if link:
                record[field] = launchpad_utils.link_to_launchpad_id(link)

        for field in BUG_FIELDS:
            record[field] = record_draft[field]

        for field in DATE_FIELDS:
            date = record_draft[field]
            if date:
                record[field] = utils.iso8601_to_timestamp(date)

        bug_id = _get_bug_id(record_draft['web_link'])
        record['module'] = primary_module
        record['id'] = utils.make_bug_id(bug_id, primary_module,
                                         record.get('release'))

        LOG.debug('New bug: %s', record)
        yield record