def validate_config(config):
    assert isinstance(config, dict)

    ssh_keys_checks_map = {
        'ssh_user': validate_ssh_user,
        'ssh_port': validate_ssh_port,
        'ssh_key_path': validate_ssh_key_path,
        'agent_list': validate_hosts_list,
        'master_list': lambda master_list: validate_master_agent_lists(master_list, config.get('agent_list'))
    }

    errors = {}
    for ssh_key, validate_func in ssh_keys_checks_map.items():
        input_value = config.get(ssh_key)
        if not input_value:
            errors[ssh_key] = 'required parameter {} was not provided'.format(ssh_key)
            continue

        try:
            validate_func(input_value)
        except __HOLE__ as err:
            errors[ssh_key] = str(err)
    return errors
dataset/ETHPy150Open dcos/dcos/ssh/validate.py/validate_config