def _eap_check_option_ok(opt: Dict[str, str], config: Dict[str, Any]):
    """ Check that a given EAP option is in the user config (if required)
     and, if specified, is the right type.

    ``opt`` should be an options dict from EAP_CONFIG_SHAPE.
    ``config`` should be the user config dict.

    Before this method is called, the validity of the eapType key should be
    established.
    """
    if opt['name'] not in config:
        if opt['required']:
            raise ConfigureArgsError(
                'Required argument {} for eap method {} not present'
                .format(opt['displayName'], config['eapType']))
        else:
            return
    name = opt['name']
    o_type = opt['type']
    arg = config[name]
    if name in config:
        if o_type in ('string', 'password') and not isinstance(arg, str):
            raise ConfigureArgsError('Option {} should be a str'
                                     .format(name))
        elif o_type == 'file' and not isinstance(arg, str):
            raise ConfigureArgsError('Option {} must be a str'
                                     .format(name))
def _eap_check_option_ok ( opt : Dict [ str , str ] , config : Dict [ str , Any ] ) : if opt [ 'name' ] not in config : if opt [ 'required' ] : raise ConfigureArgsError ( 'Required argument {} for eap method {} not present' . format ( opt [ 'displayName' ] , config [ 'eapType' ] ) ) else : return name = opt [ 'name' ] o_type = opt [ 'type' ] arg = config [ name ] if name in config : if o_type in ( 'string' , 'password' ) and not isinstance ( arg , str ) : raise ConfigureArgsError ( 'Option {} should be a str' . format ( name ) ) elif o_type == 'file' and not isinstance ( arg , str ) : raise ConfigureArgsError ( 'Option {} must be a str' . format ( name ) )
Check that a given EAP option is in the user config (if required)
     and, if specified, is the right type.

    ``opt`` should be an options dict from EAP_CONFIG_SHAPE.
    ``config`` should be the user config dict.

    Before this method is called, the validity of the eapType key should be
    established.