anchor.diff:      {ok, F} = file:open(TmpPath, [write]),
       io:format(F, "~s ~s~n", [AU, AP]),
       lists:foreach(
  -      fun({_BucketName, BucketProps}) ->
  -              {User, Pass} = proplists:get_value(auth_plain, BucketProps),
  +      fun({User, Pass}) ->
                 io:format(F, "~s ~s~n", [User, Pass])
         end,
         Buckets),
  
positive.code: terminate(_Reason, _State)     -> ok.
  code_change(_OldVsn, State, _) -> {ok, State}.
  
  handle_event({pools, V}, State) ->
      Prev = State#state.buckets,
      case extract_creds(V) of
          Prev ->
  
negative.code: %
  
  -spec extract_creds(list()) -> list().
  extract_creds(ConfigList) ->
      Configs = proplists:get_value(configs, ConfigList),
      lists:sort(
        lists:foldl(
          fun ({"default", _}, Acc) ->
                  Acc;
              ({BucketName, BucketConfig}, Acc) ->
                  case proplists:get_value(auth_type, BucketConfig) of
                      sasl ->
                          case proplists:get_value(sasl_password, BucketConfig) of
                              undefined ->
                                  Acc;
                              Password ->
                                  [{BucketName, Password}|Acc]
                          end;
                      _ ->
                          Acc
                  end
          end, [], Configs)).
  
  
  %%
  %% sasl the isasl stuff.
  %%
  
  writeSASLConf(Path, Buckets, AU, AP) ->
      writeSASLConf(Path, Buckets, AU, AP, 5, 101).
  