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 2018/04/11 18:58:49 UTC

[GitHub] mitchell852 closed pull request #2111: updated the changelog format for TC issue: #2099

mitchell852 closed pull request #2111: updated the changelog format for TC issue: #2099
URL: https://github.com/apache/incubator-trafficcontrol/pull/2111
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/traffic_ops/traffic_ops_golang/server/servers.go b/traffic_ops/traffic_ops_golang/server/servers.go
index bd25b201b..484994b96 100644
--- a/traffic_ops/traffic_ops_golang/server/servers.go
+++ b/traffic_ops/traffic_ops_golang/server/servers.go
@@ -144,11 +144,21 @@ func (server *TOServer) Validate(db *sqlx.DB) []error {
 	}
 	log.Infof("got cdn id: %d from profile and cdn id: %d from server", cdnID, *server.CDNID)
 	if cdnID != *server.CDNID {
-		errs = append(errs, errors.New("CDN of profile does not match Server CDN"))
+		errs = append(errs, errors.New(fmt.Sprintf("CDN id '%d' for profile '%d' does not match Server CDN '%d'", cdnID, *server.ProfileID, *server.CDNID)))
 	}
 	return errs
 }
 
+// ChangeLogMessage implements the api.ChangeLogger interface for a custom log message
+func (server TOServer) ChangeLogMessage(action string) (string, error) {
+	status := *server.Status
+	hostName := *server.HostName
+
+	message := action + ` ` + status + `server: { "hostName":"` + hostName + `", id:` + strconv.Itoa(*server.ID) + ` }`
+
+	return message, nil
+}
+
 func (server *TOServer) Read(db *sqlx.DB, params map[string]string, user auth.CurrentUser) ([]interface{}, []error, tc.ApiErrorType) {
 	returnable := []interface{}{}
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services