src/dirbs/cli/importer.py
def _validate_operator_id(ctx, param, val):
    """
    Process and validate operator id.

    :param ctx: current cli context obj
    :param param: param
    :param val: operator id
    :return: validated operator id
    """
    logger = logging.getLogger('dirbs.import')
    if len(val) > 16:
        raise click.BadParameter('Operator ID must be 16 chars or less')
    else:
        config = common.ensure_config(ctx)
        operator_id_list = [op.id for op in config.region_config.operators]
        if val.lower() not in operator_id_list:
            raise click.BadParameter("\'{0}\' not in {1}".format(val, operator_id_list))
        elif val != val.lower():
            logger.warning('operator_id: {0} has been changed to lower case: {1}'.format(val, val.lower()))
    return val.lower()

    Process and validate operator id.

    :param ctx: current cli context obj
    :param param: param
    :param val: operator id
    :return: validated operator id
    
Process and validate operator id.
Process and validate operator id .
def _validate_operator_id(ctx, param, val):
    logger = logging.getLogger('dirbs.import')
    if len(val) > 16:
        raise click.BadParameter('Operator ID must be 16 chars or less')
    else:
        config = common.ensure_config(ctx)
        operator_id_list = [op.id for op in config.region_config.operators]
        if val.lower() not in operator_id_list:
            raise click.BadParameter("\'{0}\' not in {1}".format(val, operator_id_list))
        elif val != val.lower():
            logger.warning('operator_id: {0} has been changed to lower case: {1}'.format(val, val.lower()))
    return val.lower()
def _validate_operator_id ( ctx , param , val ) : logger = logging . getLogger ( 'dirbs.import' ) if len ( val ) > 16 : raise click . BadParameter ( 'Operator ID must be 16 chars or less' ) else : config = common . ensure_config ( ctx ) operator_id_list = [ op . id for op in config . region_config . operators ] if val . lower ( ) not in operator_id_list : raise click . BadParameter ( "\'{0}\' not in {1}" . format ( val , operator_id_list ) ) elif val != val . lower ( ) : logger . warning ( 'operator_id: {0} has been changed to lower case: {1}' . format ( val , val . lower ( ) ) ) return val . lower ( )
Process and validate operator id.
Process and validate operator id .
"""
    Process and validate operator id.

    :param ctx: current cli context obj
    :param param: param
    :param val: operator id
    :return: validated operator id
    """
validated operator id
validated operator id
ctx
current cli context obj
current cli context obj
param
None
val
None