Example #1
0
def check_submodules():
    """Iterates through all submodules to make sure they're cloned and up to date.
    """
    for submodule in submodules.status().values():
        if submodule['status'] is None:
            cli.log.error('Submodule %s has not yet been cloned!', submodule['name'])
            return CheckStatus.ERROR
        elif not submodule['status']:
            cli.log.warning('Submodule %s is not up to date!', submodule['name'])
            return CheckStatus.WARNING

    return CheckStatus.OK
Example #2
0
def check_submodules():
    """Iterates through all submodules to make sure they're cloned and up to date.
    """
    ok = True

    for submodule in submodules.status().values():
        if submodule['status'] is None:
            cli.log.error('Submodule %s has not yet been cloned!', submodule['name'])
            ok = False
        elif not submodule['status']:
            cli.log.error('Submodule %s is not up to date!', submodule['name'])
            ok = False

    return ok
Example #3
0
def check_submodules():
    """Iterates through all submodules to make sure they're cloned and up to date.
    """
    ok = True

    for submodule in submodules.status().values():
        if submodule['status'] is None:
            if submodule['name'] in ESSENTIAL_SUBMODULES:
                cli.log.error('Submodule %s has not yet been cloned!', submodule['name'])
                ok = False
            else:
                cli.log.warn('Submodule %s is not available.', submodule['name'])
        elif not submodule['status']:
            if submodule['name'] in ESSENTIAL_SUBMODULES:
                cli.log.warn('Submodule %s is not up to date!')

    return ok
Example #4
0
def output_submodule_status():
    """Prints out information related to the submodule status.
    """
    cli.log.info('Submodule status:')
    sub_status = submodules.status()
    for s in sub_status.keys():
        sub_info = sub_status[s]
        if 'name' in sub_info:
            sub_name = sub_info['name']
            sub_shorthash = sub_info[
                'shorthash'] if 'shorthash' in sub_info else ''
            sub_describe = sub_info[
                'describe'] if 'describe' in sub_info else ''
            sub_last_log_timestamp = sub_info[
                'last_log_timestamp'] if 'last_log_timestamp' in sub_info else ''
            if sub_last_log_timestamp != '':
                cli.log.info(
                    f'- {sub_name}: {sub_last_log_timestamp} -- {sub_describe} ({sub_shorthash})'
                )
            else:
                cli.log.error(f'- {sub_name}: <<< missing or unknown >>>')