jrushford commented on a change in pull request #4980:
URL: https://github.com/apache/trafficcontrol/pull/4980#discussion_r474790741



##########
File path: traffic_ops_ort/t3c/torequest/torequest.go
##########
@@ -193,16 +193,35 @@ func (r *TrafficOpsReq) atsTcExec(cmdstr string) ([]byte, 
error) {
 
 // atsTcExecCommand is used to run the atstccfg command.
 func (r *TrafficOpsReq) atsTcExecCommand(cmdstr string, queueState int, 
revalState int) ([]byte, error) {
+       // adjust log locations used for atstccfg
+       // cannot use stdout as this will cause json parsing errors.
+       errorLocation := r.Cfg.LogLocationErr
+       if errorLocation == "stdout" {
+               errorLocation = "stderr"
+               log.Infoln("atstccfg error logging has been re-directed to 
'stderr'")
+       }
+       infoLocation := r.Cfg.LogLocationInfo
+       if infoLocation == "stdout" {
+               infoLocation = "stderr"
+               log.Infoln("atstccfg info logging has been re-directed to 
'stderr'")
+       }
+       warningLocation := r.Cfg.LogLocationWarn
+       if warningLocation == "stdout" {
+               warningLocation = "stderr"
+               log.Infoln("atstccfg warning logging has been re-directed to 
'stderr'")
+       }
+
        args := []string{
                "--traffic-ops-timeout-milliseconds=" + 
strconv.FormatInt(int64(r.Cfg.TOTimeoutMS), 10),
                "--traffic-ops-disable-proxy=" + 
strconv.FormatBool(r.Cfg.ReverseProxyDisable),
                "--traffic-ops-user=" + r.Cfg.TOUser,
                "--traffic-ops-password=" + r.Cfg.TOPass,
                "--traffic-ops-url=" + r.Cfg.TOURL,
                "--cache-host-name=" + r.Cfg.CacheHostName,
-               "--log-location-error=" + r.Cfg.LogLocationErr,
-               "--log-location-info=" + r.Cfg.LogLocationInfo,
-               "--log-location-warning=" + r.Cfg.LogLocationWarn,
+               "--log-location-error=" + errorLocation,
+               "--log-location-info=" + infoLocation,
+               "--log-location-warning=" + warningLocation,
+               "--traffic-ops-insecure",

Review comment:
       @rob05c I've added a --traffic-ops-insecure flag to t3c.  When the flag 
is true, --traffic-ops-insecure is used with atstccfg.




----------------------------------------------------------------
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:
[email protected]


Reply via email to