Validate configuration.

    :param conf_dict: test configuration.
    :type conf_dict: {}
    :raise InvalidConfigurationError:
492901
def validate_config(conf_dict):
    
    # TASK improve validation
    if APPLICATIONS not in conf_dict.keys():
        raise InvalidConfigurationError('Missing application configuration.')
    if SEED_FILES not in conf_dict.keys():
        raise InvalidConfigurationError('Missing seed file configuration.')
    if RUNS not in conf_dict.keys():
        conf_dict[RUNS] = DEFAULT_RUNS
    if PROCESSES not in conf_dict.keys():
        conf_dict[PROCESSES] = DEFAULT_PROCESSES
    if PROCESSORS not in conf_dict.keys():
        conf_dict[PROCESSORS] = DEFAULT_PROCESSORS
    return
1019351
def validate(config):
    """"""
    with open(config) as fh:
        content = fh.read()

    try:
        data = yaml.safe_load(content)
    except Exception:
        log.error("config file: %s is not valid yaml", config)
        raise

    try:
        jsonschema.validate(data, CONFIG_SCHEMA)
    except Exception:
        log.error("config file: %s is not valid", config)
        raise

    log.info("config file valid, accounts:%d", len(data['accounts']))
    return data
357931
def validate_value(config, allowed_values)
      value = instance_variable_get("@#{config}")

      return unless invalid_value?(value, allowed_values)

      message = "Configuration value `#{value}` is not allowed for `#{config}`."
      raise ConfigurationError, message
    end
320208
def _validate_allowed_settings(self, application_id, application_config, allowed_settings):
		""""""

		for setting_key in application_config.keys():
			if setting_key not in allowed_settings:
				raise ImproperlyConfigured(
					"Platform {}, app {} does not support the setting: {}.".format(
						application_config["PLATFORM"], application_id, setting_key
					)
				)
1000769
def validate_config_parameters(config_json, allowed_keys, allowed_types):
    """"""
    custom_fields = config_json.get(defs.PARAMETERS, [])
    for field in custom_fields:
        validate_field(field, allowed_keys, allowed_types)
        default = field.get(defs.DEFAULT)
        field_type = field.get(defs.TYPE)
        if default:
            validate_field_matches_type(field[defs.VALUE], default, field_type)
526029
def validate_proxies_config(cls, proxies):
        
        for name, proxy in six.iteritems(proxies):
            if "port" not in proxy:
                raise ValueError("No port defined for proxy %s" % name)
            if "upstreams" not in proxy:
                raise ValueError(
                    "No upstreams defined for proxy %s" % name
                )
            for upstream in proxy["upstreams"]:
                if "host" not in upstream:
                    raise ValueError(
                        "No host defined for upstream in proxy %s" % name
                    )
                if "port" not in upstream:
                    raise ValueError(
                        "No port defined for upstream in proxy %s" % name
                    )
878083
def __check_config_key(self, key):
        
        try:
            section, option = key.split('.')
        except (AttributeError, ValueError):
            return False

        if not section or not option:
            return False

        return section in Config.CONFIG_OPTIONS and\
            option in Config.CONFIG_OPTIONS[section]
1372834
def _validate(self, config):
        """"""
        if isinstance(config, dict):
            # Recursively validate each item in the config
            for val in config.values():
                self._validate(val)

        elif isinstance(config, list):
            # Recursively validate each item in the config
            for item in config:
                self._validate(item)

        elif isinstance(config, TaggedValue):
            tagged_value = config

            # if tagged_value is invalid, error
            if tagged_value.tag not in tagged_value.tags:
                raise InvalidConfigError(_("{} is not a valid tag for {}".format(tagged_value.tag, self.tool)))
395632
def _validate_config():
    '''
    
    '''
    if not isinstance(__opts__['azurefs'], list):
        log.error('azurefs configuration is not formed as a list, skipping azurefs')
        return False
    for container in __opts__['azurefs']:
        if not isinstance(container, dict):
            log.error(
                'One or more entries in the azurefs configuration list are '
                'not formed as a dict. Skipping azurefs: %s', container
            )
            return False
        if 'account_name' not in container or 'container_name' not in container:
            log.error(
                'An azurefs container configuration is missing either an '
                'account_name or a container_name: %s', container
            )
            return False
    return True
1099102
def _build_dict_validator(dictionary):
    """"""
    mandatory, optional, types, defaults = _determine_keys(dictionary)

    def dict_validator(data):
        """Validate dictionaries."""
        missing = list(defaults.keys())
        if not isinstance(data, dict):
            raise NotValid('%r is not of type dict' % (data,))

        validated = {}
        to_validate = list(data.keys())
        errors = _validate_mandatory_keys(
            mandatory, validated, data, to_validate)
        errors.extend(
            _validate_other_keys(
                optional, types, missing, validated, data, to_validate))
        if errors:
            raise NotValid(*errors)
        for key in missing:
            validated[key] = defaults[key][0]

        return validated

    return dict_validator
1199514
def _valid_config(config, required):
    '''
    
    '''
    re_template = r"\s*{config}\s*=.*".format(config=config)
    found = re.search(re_template, configs.exhaleDoxygenStdin)
    if required:
        return found is not None
    else:
        return found is None
503034
def _validate_config(config_path):
    '''
    
    '''
    log.debug('Checking configuration file: %s', config_path)

    if not os.path.isfile(config_path):
        message = 'Unable to get configuration file: {}'.format(config_path)
        log.error(message)
        raise SaltInvocationError(message)
    log.debug('Found configuration file: %s', config_path)
369903
def _ensureRequired(self):
        

        for configName, configDict in self.configs.items():
            if configDict['required']:
                if getattr(self._config, configName) is None:
                    raise MissingConfigurationException(configName)
530307
def validate(config):
    """"""
    with open(config) as fh:
        data = utils.yaml_load(fh.read())
        jsonschema.validate(data, CONFIG_SCHEMA)
894916
def validate_settings(settings):
    
    from django.core.exceptions import ImproperlyConfigured
    if settings.SECRET_KEY == '':
        msg = 'settings.SECRET_KEY cannot be blank! Check your local settings'
        if not settings.DEBUG:
            raise ImproperlyConfigured(msg)

    if getattr(settings, 'SESSION_COOKIE_SECURE', None) is None:
        msg = ('settings.SESSION_COOKIE_SECURE should be set to True; '
               'otherwise, your session ids can be intercepted over HTTP!')
        if not settings.DEBUG:
            raise ImproperlyConfigured(msg)

    hmac = getattr(settings, 'HMAC_KEYS', {})
    if not len(hmac.keys()):
        msg = 'settings.HMAC_KEYS cannot be empty! Check your local settings'
        if not settings.DEBUG:
            raise ImproperlyConfigured(msg)
155782
def validate(config):
    '''
    
    '''
    # Configuration for pkg beacon should be a list
    if not isinstance(config, list):
        return False, ('Configuration for pkg beacon must be a list.')

    # Configuration for pkg beacon should contain pkgs
    pkgs_found = False
    pkgs_not_list = False
    for config_item in config:
        if 'pkgs' in config_item:
            pkgs_found = True
            if isinstance(config_item['pkgs'], list):
                pkgs_not_list = True

    if not pkgs_found or not pkgs_not_list:
        return False, 'Configuration for pkg beacon requires list of pkgs.'
    return True, 'Valid beacon configuration'
1300701
function validate (config) {

	/** Make sure the config object was passed. */
	if (!config) {
		throw new TypeError('Missing configuration object.');
	}

	/** Make sure the panic url is provided. */
	if (typeof config.panic !== 'string') {
		throw new TypeError('Panic server URL "config.panic" not provided.');
	}

	/** Make sure config.clients is an array. */
	if (isArray(config.clients) === false) {
		throw new TypeError('"config.clients" is not an array.');
	}

	var str = JSON.stringify;

	/** Validate the client objects. */
	config.clients.forEach(function (client) {
		if (!client) {
			throw new Error('Client "' + client + '" is not an object.');
		}

		if (!client.type) {
			throw new Error('Missing client.type attribute: ' + str(client));
		}
	});
}