anchor.diff:  handle_bucket_info(PoolId, Id, Req, Pool, _Bucket) ->
       reply_json(Req, build_bucket_info(PoolId, Id, Pool)).
   
  -handle_bucket_info(PoolId, Id, Req) ->
  -    Pool = find_pool_by_id(PoolId),
  -    Bucket = find_bucket_by_id(Pool, Id),
  -    handle_bucket_info(PoolId, Id, Req, Pool, Bucket).
  -
   build_bucket_info(PoolId, Id, Pool) ->
       build_bucket_info(PoolId, Id, Pool, normal).
   
  
positive.code:     lists:filter(fun (C) -> C =/= true end,
                   CS).
  
  handle_port_settings_post(PostArgs, PoolId) ->
      PPort = proplists:get_value("proxyPort", PostArgs),
      DPort = proplists:get_value("directPort", PostArgs),
      case validate_port_settings(PPort, DPort) of
          [] -> {ok, fun () ->
                             Config = ns_config:get(),
                             Pools = mc_pool:pools_config_get(Config),
                             Pool = mc_pool:pool_config_get(Pools, PoolId),
                             Pool2 = lists:keystore(port, 1, Pool,
                                                    {port, list_to_integer(PPort)}),
                             mc_pool:pools_config_set(
                               mc_pool:pool_config_set(Pools, PoolId, Pool2)),
                             mc_pool:memcached_port_set(Config, undefined, DPort),
                             ok
                     end};
          Errors -> {errors, Errors}
      end.
  
  handle_traffic_generator_control_post(Req) ->
      PostArgs = Req:parse_post(),
      case proplists:get_value("onOrOff", PostArgs) of
          "off" -> ns_log:log(?MODULE, 0006, "Stopping Test Server workload from node ~p",
                              [erlang:node()]),
                   tgen:traffic_stop(),
                   Req:respond({204, add_header(), []});
          "on" -> ns_log:log(?MODULE, 0007, "Starting Test Server workload from node ~p",
                             [erlang:node()]),
                  % TODO: Use rpc:multicall here to turn off traffic
                  %       generation across all actual nodes in the cluster.
                  tgen:traffic_start(),
                  Req:respond({204, add_header(), []});
          _ ->
              ns_log:log(?MODULE, 0008, "Invalid post to testWorkload controller.  PostArgs ~p evaluated to ~p",
                         [PostArgs, proplists:get_value(PostArgs, "onOrOff")]),
              Req:respond({400, add_header(), "Bad Request\n"})
      end.
  
  % Make sure an input parameter string is clean and not too long.
  % Second argument means "undefinedIsAllowed"
  
  %% is_clean(undefined, true, _MinLen)  -> true;
  %% is_clean(undefined, false, _MinLen) -> false;
  %% is_clean(S, _UndefinedIsAllowed, MinLen) ->
  %%     Len = length(S),
  %%     (Len >= MinLen) andalso (Len < 80) andalso (S =:= (S -- " \t\n")).
  
  -ifdef(EUNIT).
  
  
negative.code: build_port_settings(PoolId) ->
      PoolConfig = find_pool_by_id(PoolId),
      [{proxyPort, proplists:get_value(port, PoolConfig)},
       {directPort, 11212}]. % TODO: this needs to come from the config
  
  validate_port_settings(ProxyPort, DirectPort) ->
      CS = [is_valid_port_number(ProxyPort) orelse <<"Proxy port must be a positive integer less than 65536">>,
  