diff --git a/cns/restserver/api.go b/cns/restserver/api.go index 7fbbe53bf8..7a3dbd9290 100644 --- a/cns/restserver/api.go +++ b/cns/restserver/api.go @@ -783,10 +783,9 @@ func (service *HTTPRestService) getHomeAz(w http.ResponseWriter, r *http.Request } func (service *HTTPRestService) createOrUpdateNetworkContainer(w http.ResponseWriter, r *http.Request) { - logger.Printf("[Azure CNS] createOrUpdateNetworkContainer") - var req cns.CreateNetworkContainerRequest if err := service.Listener.Decode(w, r, &req); err != nil { + logger.Errorf("[Azure CNS] could not decode request: %v", err) w.WriteHeader(http.StatusBadRequest) return } diff --git a/cns/restserver/util.go b/cns/restserver/util.go index 12d0325066..a3b8baaad1 100644 --- a/cns/restserver/util.go +++ b/cns/restserver/util.go @@ -49,21 +49,17 @@ func (service *HTTPRestService) removeNetworkInfo(networkName string) { // saveState writes CNS state to persistent store. func (service *HTTPRestService) saveState() error { - logger.Printf("[Azure CNS] saveState") - // Skip if a store is not provided. if service.store == nil { - logger.Printf("[Azure CNS] store not initialized.") + logger.Printf("[Azure CNS] store not initialized.") return nil } // Update time stamp. service.state.TimeStamp = time.Now() err := service.store.Write(storeKey, &service.state) - if err == nil { - logger.Printf("[Azure CNS] State saved successfully.\n") - } else { - logger.Errorf("[Azure CNS] Failed to save state., err:%v\n", err) + if err != nil { + logger.Errorf("[Azure CNS] Failed to save state, err: %v", err) } return err