more logging

pull/144/head
John Shahid 2013-12-11 18:28:36 -05:00
parent 970f7b989b
commit 8ac05f56e6
2 changed files with 3 additions and 0 deletions

View File

@ -733,8 +733,10 @@ func (self *HttpServer) tryAsDbUser(w libhttp.ResponseWriter, r *libhttp.Request
}
func (self *HttpServer) tryAsDbUserAndClusterAdmin(w libhttp.ResponseWriter, r *libhttp.Request, yield func(common.User) (int, interface{})) {
log.Debug("Trying to auth as a db user")
statusCode, body := self.tryAsDbUser(w, r, yield)
if statusCode == libhttp.StatusUnauthorized {
log.Debug("Authenticating as a db user failed with %s (%d)", string(body), statusCode)
// tryAsDbUser will set this header, since we're retrying
// we should delete the header and let tryAsClusterAdmin
// set it properly

View File

@ -66,6 +66,7 @@ func NewRaftServer(config *configuration.Configuration, clusterConfig *ClusterCo
router: mux.NewRouter(),
config: config,
}
rand.Seed(time.Now().Unix())
// Read existing name or generate a new one.
if b, err := ioutil.ReadFile(filepath.Join(s.path, "name")); err == nil {
s.name = string(b)