You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2020/07/17 16:51:40 UTC

[GitHub] [trafficcontrol] srijeet0406 commented on a change in pull request #4881: Renaming a host in TC, does not impact hash_id

srijeet0406 commented on a change in pull request #4881:
URL: https://github.com/apache/trafficcontrol/pull/4881#discussion_r456556553



##########
File path: traffic_ops/testing/api/v3/servers_test.go
##########
@@ -248,6 +249,8 @@ func UpdateTestServers(t *testing.T) {
 
 	// Retrieve the server by hostname so we can get the id for the Update
 	resp, _, err := TOSession.GetServers(&params, nil)
+	originalHostname := *resp.Response[0].HostName

Review comment:
       Same comment here.

##########
File path: traffic_ops/testing/api/v2/servers_test.go
##########
@@ -101,17 +101,23 @@ func UpdateTestServers(t *testing.T) {
 	hostName := firstServer.HostName
 	// Retrieve the server by hostname so we can get the id for the Update
 	resp, _, err := TOSession.GetServerByHostName(hostName)
+	originalHostname := resp[0].HostName

Review comment:
       We should probably do this after we check that the error is nil. In case we dont get back a valid resp, this can throw a seg fault due to dereferencing of a nil ptr.

##########
File path: traffic_ops/traffic_ops_golang/server/servers.go
##########
@@ -992,6 +992,9 @@ func Update(w http.ResponseWriter, r *http.Request) {
 			api.HandleErr(w, r, tx, http.StatusBadRequest, err, nil)
 			return
 		}
+		if newServer.XMPPID != nil {
+			fmt.Println("Change in xmpp_id was requested but it will be ignored to ensure hashId remains consistent")

Review comment:
       Change to `log.Debugln` or something like that




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org