anchor.diff:           validate_has_params/1,
            validate_memory_quota/2,
            validate_any_value/2,
  +         validate_by_fun/3,
            execute_if_validated/3]).
   
   %% used by parse_validate_number
  
positive.code:                end,
      validate_range(Name, Min, Max, ErrorFun, State).
  
  validate_range(Name, Min, Max, ErrorFun, {_, InList, _} = State) ->
      Value = proplists:get_value(Name, InList),
      case Value of
          undefined ->
              State;
          _ ->
              case (Value >= Min) andalso (Value =< Max) of
                  true ->
                      State;
                  false ->
                      return_error(Name, ErrorFun(Name, Min, Max), State)
              end
      end.
  
  validate_unsupported_params({OutList, InList, Errors}) ->
      NewErrors = [{list_to_binary(Key),
  
negative.code: validate_has_params(State) ->
      State.
  
  validate_memory_quota(Name, State) ->
      validate_by_fun(fun (MemoryQuota) ->
                              {MinMemoryMB, MaxMemoryMB, QuotaErrorDetailsFun} =
                                  ns_storage_conf:allowed_node_quota_range(),
                              if
                                  MemoryQuota < MinMemoryMB ->
                                      {error, ["The RAM Quota value is too small.", QuotaErrorDetailsFun()]};
                                  MemoryQuota > MaxMemoryMB ->
                                      {error, ["The RAM Quota value is too large.", QuotaErrorDetailsFun()]};
                                  true ->
                                      ok
                              end
                      end, Name, State).
  
  validate_any_value(Name, {OutList, _, _} = State) ->
      case lists:keyfind(atom_to_list(Name), 1, OutList) of
  