Пример #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 = {}

        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.get_bug_id(module, bug_id)

        LOG.debug('New bug: %s', record)
        yield record
Пример #2
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 = {}

        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.get_bug_id(module, bug_id)

        LOG.debug('New bug: %s', record)
        yield record
Пример #3
0
def _log_module(module, primary_module):
    for record in launchpad_utils.lp_blueprint_generator(module):
        for field in LINK_FIELDS:
            link = record[field + '_link']
            if link:
                record[field] = launchpad_utils.link_to_launchpad_id(link)
                del record[field + '_link']
        for field in DATE_FIELDS:
            date = record[field]
            if date:
                record[field] = utils.iso8601_to_timestamp(date)

        record['module'] = primary_module
        record['id'] = utils.get_blueprint_id(primary_module, record['name'])

        LOG.debug('New blueprint: %s', record)
        yield record
Пример #4
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
Пример #5
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
Пример #6
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
Пример #7
0
def log(repo):
    module = repo['module']
    LOG.debug('Retrieving list of blueprints 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 in launchpad_utils.lp_blueprint_generator(module):
        for field in LINK_FIELDS:
            link = record[field + '_link']
            if link:
                record[field] = launchpad_utils.link_to_launchpad_id(link)
                del record[field + '_link']
        for field in DATE_FIELDS:
            date = record[field]
            if date:
                record[field] = utils.iso8601_to_timestamp(date)

        record['module'] = module
        record['id'] = utils.get_blueprint_id(module, record['name'])

        LOG.debug('New blueprint: %s', record)
        yield record
Пример #8
0
def log(repo):
    module = repo['module']
    LOG.debug('Retrieving list of blueprints 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 in launchpad_utils.lp_blueprint_generator(module):
        for field in LINK_FIELDS:
            link = record[field + '_link']
            if link:
                record[field] = launchpad_utils.link_to_launchpad_id(link)
                del record[field + '_link']
        for field in DATE_FIELDS:
            date = record[field]
            if date:
                record[field] = utils.iso8601_to_timestamp(date)

        record['module'] = module
        record['id'] = utils.get_blueprint_id(module, record['name'])

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