This is an automated email from the ASF dual-hosted git repository.
rob pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new 41027d8 Adding atscfg overrides to insert the Release version in via
string (#5470)
41027d8 is described below
commit 41027d8d4f03d61058afe6ee21438d647251af8e
Author: Evan Zelkowitz <[email protected]>
AuthorDate: Wed Feb 3 15:49:18 2021 -0700
Adding atscfg overrides to insert the Release version in via string (#5470)
* Adding atscfg overrides to insert the Release version, which is the build
hash of ATS, instead of the actual ATS version number
This also adds atscfg and ort command line options for both the release
version via string as well as a previous option
to disable per line comments in parent.config
* Change option to `--verify--string-release`
* Fix test case that is now failing with the new func call
* Fix recordsconfig atstccfg test
* Fix perl var naming to be disable throughout and change help text
* Fix ort.pl atstccfg cmd line arg to match new name
---
.../cdn-in-a-box/ort/traffic_ops_ort/__init__.py | 8 +++
.../ort/traffic_ops_ort/configuration.py | 2 +
.../cdn-in-a-box/ort/traffic_ops_ort/to_api.py | 5 +-
lib/go-atscfg/recordsdotconfig.go | 64 +++++++++++++++++-
lib/go-atscfg/recordsdotconfig_test.go | 4 +-
traffic_ops_ort/atstccfg/README.md | 7 ++
traffic_ops_ort/atstccfg/atstccfg.go | 2 +-
traffic_ops_ort/atstccfg/cfgfile/all.go | 12 ++--
traffic_ops_ort/atstccfg/cfgfile/cfgfile_test.go | 14 +++-
traffic_ops_ort/atstccfg/cfgfile/routing.go | 6 +-
traffic_ops_ort/atstccfg/cfgfile/wrappers.go | 77 ++++++++++++----------
traffic_ops_ort/atstccfg/config/config.go | 8 +++
traffic_ops_ort/traffic_ops_ort.pl | 34 +++++++---
13 files changed, 180 insertions(+), 63 deletions(-)
diff --git a/infrastructure/cdn-in-a-box/ort/traffic_ops_ort/__init__.py
b/infrastructure/cdn-in-a-box/ort/traffic_ops_ort/__init__.py
index 19daabf..83a5d47 100644
--- a/infrastructure/cdn-in-a-box/ort/traffic_ops_ort/__init__.py
+++ b/infrastructure/cdn-in-a-box/ort/traffic_ops_ort/__init__.py
@@ -472,6 +472,14 @@ def main() -> int:
help="Sets the timeout in milliseconds for requests
made to Traffic Ops.",
type=int,
default=None)
+ parser.add_argument("--via-string-release",
+ help="set the ATS via string to the
package release instead of version",
+ type=int,
+ default=0)
+ parser.add_argument("--disable-parent-config-comments",
+ help="Do not insert comments in
parent.config files",
+ type=int,
+ default=0)
parser.add_argument("-v", "--version",
action="version",
version="%(prog)s v"+__version__,
diff --git a/infrastructure/cdn-in-a-box/ort/traffic_ops_ort/configuration.py
b/infrastructure/cdn-in-a-box/ort/traffic_ops_ort/configuration.py
index 84ff919..3ead0f5 100644
--- a/infrastructure/cdn-in-a-box/ort/traffic_ops_ort/configuration.py
+++ b/infrastructure/cdn-in-a-box/ort/traffic_ops_ort/configuration.py
@@ -113,6 +113,8 @@ class Configuration():
self.rev_proxy_disable = args.rev_proxy_disable
self.verify = not args.insecure
self.timeout = args.timeout
+ self.via_string_release = args.via_string_release
+ self.disable_parent_config_comments =
args.disable_parent_config_comments
setLogLevel(args.log_level)
diff --git a/infrastructure/cdn-in-a-box/ort/traffic_ops_ort/to_api.py
b/infrastructure/cdn-in-a-box/ort/traffic_ops_ort/to_api.py
index 2a292fd..8b6cdb3 100644
--- a/infrastructure/cdn-in-a-box/ort/traffic_ops_ort/to_api.py
+++ b/infrastructure/cdn-in-a-box/ort/traffic_ops_ort/to_api.py
@@ -91,7 +91,10 @@ class API(TOSession):
self.atstccfg_cmd.append("--traffic-ops-disable-proxy")
if not conf.verify:
self.atstccfg_cmd.append("--traffic-ops-insecure")
-
+ if conf.via_string_release > 0:
+ self.atstccfg_cmd.append("--via-string-release")
+ if conf.disable_parent_config_comments > 0:
+
self.atstccfg_cmd.append("--disable-parent-config-comments")
def __enter__(self):
"""
diff --git a/lib/go-atscfg/recordsdotconfig.go
b/lib/go-atscfg/recordsdotconfig.go
index 784e9f8..d662841 100644
--- a/lib/go-atscfg/recordsdotconfig.go
+++ b/lib/go-atscfg/recordsdotconfig.go
@@ -20,6 +20,7 @@ package atscfg
*/
import (
+ "os/exec"
"strings"
"github.com/apache/trafficcontrol/lib/go-tc"
@@ -30,10 +31,19 @@ const RecordsFileName = "records.config"
const ContentTypeRecordsDotConfig = ContentTypeTextASCII
const LineCommentRecordsDotConfig = LineCommentHash
+type RecordsConfigOpts struct {
+ // ReleaseViaStr is whether or not we replace the via and server
strings in ATS
+ // responses to be the Release value from the rpm package. This can be
a user
+ // defined build hash (or whatever the user wants) type value to give
more
+ // specific info as well as obfuscating the real ATS version from
prying eyes
+ ReleaseViaStr bool
+}
+
func MakeRecordsDotConfig(
server *Server,
serverParams []tc.Parameter,
hdrComment string,
+ opt RecordsConfigOpts,
) (Cfg, error) {
warnings := []string{}
if server.Profile == nil {
@@ -51,7 +61,7 @@ func MakeRecordsDotConfig(
txt = replaceLineSuffixes(txt, "STRING __HOSTNAME__", "STRING
__FULL_HOSTNAME__")
txt = hdr + txt
- txt, overrideWarns := addRecordsDotConfigOverrides(txt, server)
+ txt, overrideWarns := addRecordsDotConfigOverrides(txt, server, opt)
warnings = append(warnings, overrideWarns...)
return Cfg{
@@ -64,10 +74,17 @@ func MakeRecordsDotConfig(
// addRecordsDotConfigOverrides modifies the records.config text and adds any
overrides.
// Returns the modified text and any warnings.
-func addRecordsDotConfigOverrides(txt string, server *Server) (string,
[]string) {
+func addRecordsDotConfigOverrides(txt string, server *Server, opt
RecordsConfigOpts) (string, []string) {
warnings := []string{}
txt, ipWarns := addRecordsDotConfigOutgoingIP(txt, server)
warnings = append(warnings, ipWarns...)
+
+ if opt.ReleaseViaStr {
+ viaWarns := []string{}
+ txt, viaWarns = addRecordsDotConfigViaStr(txt)
+ warnings = append(warnings, viaWarns...)
+ }
+
return txt, warnings
}
@@ -95,6 +112,49 @@ func addRecordsDotConfigOutgoingIP(txt string, server
*Server) (string, []string
return txt, warnings
}
+// addRecordsDotConfigViaStr returns the request, response, and response
server via strings with the current Release (a.k.a. build version and not ATS
version), and any warnings.
+func addRecordsDotConfigViaStr(txt string) (string, []string) {
+ warnings := []string{}
+
+ requestViaStr := `proxy.config.http.request_via_str`
+ responseViaStr := `proxy.config.http.response_via_str`
+ responseServerStr := `proxy.config.http.response_server_str`
+
+ cmd := "yum info installed trafficserver | grep Release"
+ yumOutput, err := exec.Command("sh", "-c", cmd).Output()
+
+ if err != nil {
+ warnings = append(warnings, "could not read trafficserver
release information from yum! Not setting via strings")
+ return txt, warnings
+ }
+
+ releaseVerSlice := strings.Split(string(yumOutput), " ")
+ releaseVer := releaseVerSlice[len(releaseVerSlice)-1]
+
+ if strings.Contains(txt, requestViaStr) {
+ warnings = append(warnings, "records.config had a
proxy.config.http.request_via_str Parameter! Using Parameter, not setting
request via string")
+ } else {
+ txt = txt + `CONFIG ` + requestViaStr + ` STRING ` + releaseVer
+ txt += "\n"
+ }
+
+ if strings.Contains(txt, responseViaStr) {
+ warnings = append(warnings, "records.config had a
proxy.config.http.response_via_str Parameter! Using Parameter, not setting
response via string")
+ } else {
+ txt = txt + `CONFIG ` + responseViaStr + ` STRING ` + releaseVer
+ txt += "\n"
+ }
+
+ if strings.Contains(txt, responseServerStr) {
+ warnings = append(warnings, "records.config had a
proxy.config.http.response_server_str Parameter! Using Parameter, not setting
response server string")
+ } else {
+ txt = txt + `CONFIG ` + responseServerStr + ` STRING ` +
releaseVer
+ txt += "\n"
+ }
+
+ return txt, warnings
+}
+
func replaceLineSuffixes(txt string, suffix string, newSuffix string) string {
lines := strings.Split(txt, "\n")
newLines := make([]string, 0, len(lines))
diff --git a/lib/go-atscfg/recordsdotconfig_test.go
b/lib/go-atscfg/recordsdotconfig_test.go
index db34f88..e4649a9 100644
--- a/lib/go-atscfg/recordsdotconfig_test.go
+++ b/lib/go-atscfg/recordsdotconfig_test.go
@@ -41,8 +41,8 @@ func TestMakeRecordsDotConfig(t *testing.T) {
ipStr := "192.168.2.99"
setIP(server, ipStr)
server.Profile = util.StrPtr(profileName)
-
- cfg, err := MakeRecordsDotConfig(server, paramData, hdr)
+ opt := RecordsConfigOpts{}
+ cfg, err := MakeRecordsDotConfig(server, paramData, hdr, opt)
if err != nil {
t.Fatal(err)
}
diff --git a/traffic_ops_ort/atstccfg/README.md
b/traffic_ops_ort/atstccfg/README.md
index 21e3d14..1f8b780 100644
--- a/traffic_ops_ort/atstccfg/README.md
+++ b/traffic_ops_ort/atstccfg/README.md
@@ -105,6 +105,13 @@ The available options are:
invalidation jobs. For Apache Traffic Server implementations, this limits
the output to be only files named 'regex_revalidate.config'. Has no effect
if --get-data or --set-queue-status/--set-reval-status is/are used.
+--via_string_release
+ Using this option will set the via string records.config options for Apache
+ Traffic Server so that it will have the rpm file release information in
the via
+ string instead of the actual ATS version
+--disable-parent-config-comments
+ Disables having per-line parent.config comments. The file header will
still be
+ generated.
```
# Development
diff --git a/traffic_ops_ort/atstccfg/atstccfg.go
b/traffic_ops_ort/atstccfg/atstccfg.go
index 1b0ba8c..c535f8f 100644
--- a/traffic_ops_ort/atstccfg/atstccfg.go
+++ b/traffic_ops_ort/atstccfg/atstccfg.go
@@ -120,7 +120,7 @@ func main() {
os.Exit(config.ExitCodeErrGeneric)
}
- configs, err := cfgfile.GetAllConfigs(toData, tccfg.RevalOnly,
tccfg.Dir, config.UserAgent, tccfg.TOClient.C.URL, toIPs)
+ configs, err := cfgfile.GetAllConfigs(toData, config.UserAgent, toIPs,
tccfg)
if err != nil {
log.Errorln("Getting config for'" + cfg.CacheHostName + "': " +
err.Error())
os.Exit(config.ExitCodeErrGeneric)
diff --git a/traffic_ops_ort/atstccfg/cfgfile/all.go
b/traffic_ops_ort/atstccfg/cfgfile/all.go
index 4c36768..1c82791 100644
--- a/traffic_ops_ort/atstccfg/cfgfile/all.go
+++ b/traffic_ops_ort/atstccfg/cfgfile/all.go
@@ -42,32 +42,30 @@ import (
// GetAllConfigs gets all config files for cfg.CacheHostName.
func GetAllConfigs(
toData *config.TOData,
- revalOnly bool,
- dir string,
appVersion string,
- toURL string,
toIPs []net.Addr,
+ cfg config.TCCfg,
) ([]config.ATSConfigFile, error) {
if toData.Server.HostName == nil {
return nil, errors.New("server hostname is nil")
}
- configFiles, warnings, err := MakeConfigFilesList(toData, dir)
+ configFiles, warnings, err := MakeConfigFilesList(toData, cfg.Dir)
logWarnings("generating config files list: ", warnings)
if err != nil {
return nil, errors.New("creating meta: " + err.Error())
}
genTime := time.Now()
- hdrCommentTxt := makeHeaderComment(*toData.Server.HostName, appVersion,
toURL, toIPs, genTime)
+ hdrCommentTxt := makeHeaderComment(*toData.Server.HostName, appVersion,
cfg.TOClient.C.URL, toIPs, genTime)
hasSSLMultiCertConfig := false
configs := []config.ATSConfigFile{}
for _, fi := range configFiles {
- if revalOnly && fi.Name != atscfg.RegexRevalidateFileName {
+ if cfg.RevalOnly && fi.Name != atscfg.RegexRevalidateFileName {
continue
}
- txt, contentType, lineComment, err := GetConfigFile(toData, fi,
hdrCommentTxt)
+ txt, contentType, lineComment, err := GetConfigFile(toData, fi,
hdrCommentTxt, cfg)
if err != nil {
return nil, errors.New("getting config file '" +
fi.Name + "': " + err.Error())
}
diff --git a/traffic_ops_ort/atstccfg/cfgfile/cfgfile_test.go
b/traffic_ops_ort/atstccfg/cfgfile/cfgfile_test.go
index fcf7253..4cbb966 100644
--- a/traffic_ops_ort/atstccfg/cfgfile/cfgfile_test.go
+++ b/traffic_ops_ort/atstccfg/cfgfile/cfgfile_test.go
@@ -29,7 +29,9 @@ import (
"github.com/apache/trafficcontrol/lib/go-atscfg"
"github.com/apache/trafficcontrol/lib/go-tc"
"github.com/apache/trafficcontrol/lib/go-util"
+ client "github.com/apache/trafficcontrol/traffic_ops/v1-client"
"github.com/apache/trafficcontrol/traffic_ops_ort/atstccfg/config"
+ "github.com/apache/trafficcontrol/traffic_ops_ort/atstccfg/toreq"
)
func TestWriteConfigs(t *testing.T) {
@@ -140,7 +142,14 @@ func TestGetAllConfigsWriteConfigsDeterministic(t
*testing.T) {
revalOnly := false
cfgPath := "/etc/trafficserver/"
- configs, err := GetAllConfigs(toData, revalOnly, cfgPath, "", "", nil)
+ cfg := config.TCCfg{}
+ cfg.Dir = cfgPath
+ cfg.RevalOnly = revalOnly
+ cfg.TOClient = &toreq.TOClient{}
+ cfg.TOClient.C = &client.Session{}
+ cfg.TOClient.C.URL = ""
+
+ configs, err := GetAllConfigs(toData, "", nil, cfg)
if err != nil {
t.Fatalf("error getting configs: " + err.Error())
}
@@ -149,11 +158,10 @@ func TestGetAllConfigsWriteConfigsDeterministic(t
*testing.T) {
t.Fatalf("error writing configs: " + err.Error())
}
configStr := buf.String()
-
configStr = removeComments(configStr)
for i := 0; i < 10; i++ {
- configs2, err := GetAllConfigs(toData, revalOnly, cfgPath, "",
"", nil)
+ configs2, err := GetAllConfigs(toData, "", nil, cfg)
if err != nil {
t.Fatalf("error getting configs2: " + err.Error())
}
diff --git a/traffic_ops_ort/atstccfg/cfgfile/routing.go
b/traffic_ops_ort/atstccfg/cfgfile/routing.go
index d5ab0e1..82df4d8 100644
--- a/traffic_ops_ort/atstccfg/cfgfile/routing.go
+++ b/traffic_ops_ort/atstccfg/cfgfile/routing.go
@@ -31,7 +31,7 @@ import (
// # DO NOT EDIT - Generated for odol-atsec-sea-22 by Traffic Ops
(https://trafficops.comcast.net/) on Mon Oct 26 16:22:19 UTC 2020
// GetConfigFile returns the text of the generated config file, the MIME
Content Type of the config file, and any error.
-func GetConfigFile(toData *config.TOData, fileInfo atscfg.CfgMeta,
hdrCommentTxt string) (string, string, string, error) {
+func GetConfigFile(toData *config.TOData, fileInfo atscfg.CfgMeta,
hdrCommentTxt string, thiscfg config.TCCfg) (string, string, string, error) {
start := time.Now()
defer func() {
log.Infof("GetConfigFile %v took %v\n", fileInfo.Name,
time.Since(start).Round(time.Millisecond))
@@ -39,7 +39,7 @@ func GetConfigFile(toData *config.TOData, fileInfo
atscfg.CfgMeta, hdrCommentTxt
log.Infoln("GetConfigFile '" + fileInfo.Name + "'")
getConfigFile := getConfigFileFunc(fileInfo.Name)
- cfg, err := getConfigFile(toData, fileInfo.Name, hdrCommentTxt)
+ cfg, err := getConfigFile(toData, fileInfo.Name, hdrCommentTxt, thiscfg)
logWarnings("getting config file '"+fileInfo.Name+"': ", cfg.Warnings)
if err != nil {
@@ -48,7 +48,7 @@ func GetConfigFile(toData *config.TOData, fileInfo
atscfg.CfgMeta, hdrCommentTxt
return cfg.Text, cfg.ContentType, cfg.LineComment, nil
}
-type ConfigFileFunc func(toData *config.TOData, fileName string, hdrCommentTxt
string) (atscfg.Cfg, error)
+type ConfigFileFunc func(toData *config.TOData, fileName string, hdrCommentTxt
string, cfg config.TCCfg) (atscfg.Cfg, error)
type ConfigFilePrefixSuffixFunc struct {
Prefix string
diff --git a/traffic_ops_ort/atstccfg/cfgfile/wrappers.go
b/traffic_ops_ort/atstccfg/cfgfile/wrappers.go
index b74e034..5d78867 100644
--- a/traffic_ops_ort/atstccfg/cfgfile/wrappers.go
+++ b/traffic_ops_ort/atstccfg/cfgfile/wrappers.go
@@ -47,47 +47,47 @@ func MakeConfigFilesList(toData *config.TOData, dir string)
([]atscfg.CfgMeta, [
return configFiles, warnings, err
}
-func Make12MFacts(toData *config.TOData, fileName string, hdrCommentTxt
string) (atscfg.Cfg, error) {
+func Make12MFacts(toData *config.TOData, fileName string, hdrCommentTxt
string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.Make12MFacts(toData.Server, hdrCommentTxt)
}
-func MakeATSDotRules(toData *config.TOData, fileName string, hdrCommentTxt
string) (atscfg.Cfg, error) {
+func MakeATSDotRules(toData *config.TOData, fileName string, hdrCommentTxt
string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeATSDotRules(toData.Server, toData.ServerParams,
hdrCommentTxt)
}
-func MakeAstatsDotConfig(toData *config.TOData, fileName string, hdrCommentTxt
string) (atscfg.Cfg, error) {
+func MakeAstatsDotConfig(toData *config.TOData, fileName string, hdrCommentTxt
string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeAStatsDotConfig(toData.Server, toData.ServerParams,
hdrCommentTxt)
}
-func MakeBGFetchDotConfig(toData *config.TOData, fileName string,
hdrCommentTxt string) (atscfg.Cfg, error) {
+func MakeBGFetchDotConfig(toData *config.TOData, fileName string,
hdrCommentTxt string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeBGFetchDotConfig(toData.Server, hdrCommentTxt)
}
-func MakeCacheDotConfig(toData *config.TOData, fileName string, hdrCommentTxt
string) (atscfg.Cfg, error) {
+func MakeCacheDotConfig(toData *config.TOData, fileName string, hdrCommentTxt
string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeCacheDotConfig(toData.Server, toData.Servers,
toData.DeliveryServices, toData.DeliveryServiceServers, hdrCommentTxt)
}
-func MakeCacheURL(toData *config.TOData, fileName string, hdrCommentTxt
string) (atscfg.Cfg, error) {
+func MakeCacheURL(toData *config.TOData, fileName string, hdrCommentTxt
string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeCacheURLDotConfig(fileName, toData.Server,
toData.DeliveryServices, toData.DeliveryServiceServers, hdrCommentTxt)
}
-func MakeCacheURLPlain(toData *config.TOData, fileName string, hdrCommentTxt
string) (atscfg.Cfg, error) {
- return MakeCacheURL(toData, "cacheurl.config", hdrCommentTxt)
+func MakeCacheURLPlain(toData *config.TOData, fileName string, hdrCommentTxt
string, cfg config.TCCfg) (atscfg.Cfg, error) {
+ return MakeCacheURL(toData, "cacheurl.config", hdrCommentTxt, cfg)
}
-func MakeChkconfig(toData *config.TOData, fileName string, hdrCommentTxt
string) (atscfg.Cfg, error) {
+func MakeChkconfig(toData *config.TOData, fileName string, hdrCommentTxt
string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeChkconfig(toData.ServerParams)
}
-func MakeDropQStringDotConfig(toData *config.TOData, fileName string,
hdrCommentTxt string) (atscfg.Cfg, error) {
+func MakeDropQStringDotConfig(toData *config.TOData, fileName string,
hdrCommentTxt string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeDropQStringDotConfig(toData.Server,
toData.ServerParams, hdrCommentTxt)
}
-func MakeHostingDotConfig(toData *config.TOData, fileName string,
hdrCommentTxt string) (atscfg.Cfg, error) {
+func MakeHostingDotConfig(toData *config.TOData, fileName string,
hdrCommentTxt string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeHostingDotConfig(toData.Server, toData.Servers,
toData.ServerParams, toData.DeliveryServices, toData.DeliveryServiceServers,
toData.Topologies, hdrCommentTxt)
}
-func MakeIPAllowDotConfig(toData *config.TOData, fileName string,
hdrCommentTxt string) (atscfg.Cfg, error) {
+func MakeIPAllowDotConfig(toData *config.TOData, fileName string,
hdrCommentTxt string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeIPAllowDotConfig(
toData.ServerParams,
toData.Server,
@@ -98,23 +98,23 @@ func MakeIPAllowDotConfig(toData *config.TOData, fileName
string, hdrCommentTxt
)
}
-func MakeLoggingDotConfig(toData *config.TOData, fileName string,
hdrCommentTxt string) (atscfg.Cfg, error) {
+func MakeLoggingDotConfig(toData *config.TOData, fileName string,
hdrCommentTxt string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeLoggingDotConfig(toData.Server, toData.ServerParams,
hdrCommentTxt)
}
-func MakeLoggingDotYAML(toData *config.TOData, fileName string, hdrCommentTxt
string) (atscfg.Cfg, error) {
+func MakeLoggingDotYAML(toData *config.TOData, fileName string, hdrCommentTxt
string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeLoggingDotYAML(toData.Server, toData.ServerParams,
hdrCommentTxt)
}
-func MakeLogsXMLDotConfig(toData *config.TOData, fileName string,
hdrCommentTxt string) (atscfg.Cfg, error) {
+func MakeLogsXMLDotConfig(toData *config.TOData, fileName string,
hdrCommentTxt string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeLogsXMLDotConfig(toData.Server, toData.ServerParams,
hdrCommentTxt)
}
-func MakePackages(toData *config.TOData, fileName string, hdrCommentTxt
string) (atscfg.Cfg, error) {
+func MakePackages(toData *config.TOData, fileName string, hdrCommentTxt
string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakePackages(toData.ServerParams)
}
-func MakeParentDotConfig(toData *config.TOData, fileName string, hdrCommentTxt
string) (atscfg.Cfg, error) {
+func MakeParentDotConfig(toData *config.TOData, fileName string, hdrCommentTxt
string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeParentDotConfig(
toData.DeliveryServices,
toData.Server,
@@ -129,24 +129,31 @@ func MakeParentDotConfig(toData *config.TOData, fileName
string, hdrCommentTxt s
toData.CDN,
atscfg.ParentConfigOpts{
HdrComment: hdrCommentTxt,
- AddComments: true, // TODO add a CLI flag?
+ AddComments: cfg.ParentComments, // TODO add a CLI flag?
},
)
}
-func MakePluginDotConfig(toData *config.TOData, fileName string, hdrCommentTxt
string) (atscfg.Cfg, error) {
+func MakePluginDotConfig(toData *config.TOData, fileName string, hdrCommentTxt
string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakePluginDotConfig(toData.Server, toData.ServerParams,
hdrCommentTxt)
}
-func MakeRecordsDotConfig(toData *config.TOData, fileName string,
hdrCommentTxt string) (atscfg.Cfg, error) {
- return atscfg.MakeRecordsDotConfig(toData.Server, toData.ServerParams,
hdrCommentTxt)
+func MakeRecordsDotConfig(toData *config.TOData, fileName string,
hdrCommentTxt string, cfg config.TCCfg) (atscfg.Cfg, error) {
+ return atscfg.MakeRecordsDotConfig(
+ toData.Server,
+ toData.ServerParams,
+ hdrCommentTxt,
+ atscfg.RecordsConfigOpts{
+ ReleaseViaStr: cfg.ViaRelease,
+ },
+ )
}
-func MakeRegexRevalidateDotConfig(toData *config.TOData, fileName string,
hdrCommentTxt string) (atscfg.Cfg, error) {
+func MakeRegexRevalidateDotConfig(toData *config.TOData, fileName string,
hdrCommentTxt string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeRegexRevalidateDotConfig(toData.Server,
toData.DeliveryServices, toData.GlobalParams, toData.Jobs, hdrCommentTxt)
}
-func MakeRemapDotConfig(toData *config.TOData, fileName string, hdrCommentTxt
string) (atscfg.Cfg, error) {
+func MakeRemapDotConfig(toData *config.TOData, fileName string, hdrCommentTxt
string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeRemapDotConfig(
toData.Server,
toData.DeliveryServices,
@@ -163,27 +170,27 @@ func MakeRemapDotConfig(toData *config.TOData, fileName
string, hdrCommentTxt st
)
}
-func MakeSSLMultiCertDotConfig(toData *config.TOData, fileName string,
hdrCommentTxt string) (atscfg.Cfg, error) {
+func MakeSSLMultiCertDotConfig(toData *config.TOData, fileName string,
hdrCommentTxt string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeSSLMultiCertDotConfig(toData.Server,
toData.DeliveryServices, hdrCommentTxt)
}
-func MakeStorageDotConfig(toData *config.TOData, fileName string,
hdrCommentTxt string) (atscfg.Cfg, error) {
+func MakeStorageDotConfig(toData *config.TOData, fileName string,
hdrCommentTxt string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeStorageDotConfig(toData.Server, toData.ServerParams,
hdrCommentTxt)
}
-func MakeSysCtlDotConf(toData *config.TOData, fileName string, hdrCommentTxt
string) (atscfg.Cfg, error) {
+func MakeSysCtlDotConf(toData *config.TOData, fileName string, hdrCommentTxt
string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeSysCtlDotConf(toData.Server, toData.ServerParams,
hdrCommentTxt)
}
-func MakeVolumeDotConfig(toData *config.TOData, fileName string, hdrCommentTxt
string) (atscfg.Cfg, error) {
+func MakeVolumeDotConfig(toData *config.TOData, fileName string, hdrCommentTxt
string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeVolumeDotConfig(toData.Server, toData.ServerParams,
hdrCommentTxt)
}
-func MakeHeaderRewriteMid(toData *config.TOData, fileName string,
hdrCommentTxt string) (atscfg.Cfg, error) {
+func MakeHeaderRewriteMid(toData *config.TOData, fileName string,
hdrCommentTxt string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeHeaderRewriteMidDotConfig(fileName,
toData.DeliveryServices, toData.DeliveryServiceServers, toData.Server,
toData.Servers, toData.CacheGroups, hdrCommentTxt)
}
-func MakeTopologyHeaderRewrite(toData *config.TOData, fileName string,
hdrCommentTxt string) (atscfg.Cfg, error) {
+func MakeTopologyHeaderRewrite(toData *config.TOData, fileName string,
hdrCommentTxt string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeTopologyHeaderRewriteDotConfig(
fileName,
toData.Server,
@@ -196,26 +203,26 @@ func MakeTopologyHeaderRewrite(toData *config.TOData,
fileName string, hdrCommen
)
}
-func MakeHeaderRewrite(toData *config.TOData, fileName string, hdrCommentTxt
string) (atscfg.Cfg, error) {
+func MakeHeaderRewrite(toData *config.TOData, fileName string, hdrCommentTxt
string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeHeaderRewriteDotConfig(fileName,
toData.DeliveryServices, toData.DeliveryServiceServers, toData.Server,
toData.Servers, hdrCommentTxt)
}
-func MakeRegexRemap(toData *config.TOData, fileName string, hdrCommentTxt
string) (atscfg.Cfg, error) {
+func MakeRegexRemap(toData *config.TOData, fileName string, hdrCommentTxt
string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeRegexRemapDotConfig(fileName, toData.Server,
toData.DeliveryServices, hdrCommentTxt)
}
-func MakeSetDSCP(toData *config.TOData, fileName string, hdrCommentTxt string)
(atscfg.Cfg, error) {
+func MakeSetDSCP(toData *config.TOData, fileName string, hdrCommentTxt string,
cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeSetDSCPDotConfig(fileName, toData.Server,
hdrCommentTxt)
}
-func MakeURLSigConfig(toData *config.TOData, fileName string, hdrCommentTxt
string) (atscfg.Cfg, error) {
+func MakeURLSigConfig(toData *config.TOData, fileName string, hdrCommentTxt
string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeURLSigConfig(fileName, toData.Server,
toData.ServerParams, toData.URLSigKeys, hdrCommentTxt)
}
-func MakeURISigningConfig(toData *config.TOData, fileName string,
hdrCommentTxt string) (atscfg.Cfg, error) {
+func MakeURISigningConfig(toData *config.TOData, fileName string,
hdrCommentTxt string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeURISigningConfig(fileName, toData.URISigningKeys)
}
-func MakeUnknownConfig(toData *config.TOData, fileName string, hdrCommentTxt
string) (atscfg.Cfg, error) {
+func MakeUnknownConfig(toData *config.TOData, fileName string, hdrCommentTxt
string, cfg config.TCCfg) (atscfg.Cfg, error) {
return atscfg.MakeServerUnknown(fileName, toData.Server,
toData.ServerParams, hdrCommentTxt)
}
diff --git a/traffic_ops_ort/atstccfg/config/config.go
b/traffic_ops_ort/atstccfg/config/config.go
index 4325bd9..d829826 100644
--- a/traffic_ops_ort/atstccfg/config/config.go
+++ b/traffic_ops_ort/atstccfg/config/config.go
@@ -66,6 +66,8 @@ type Cfg struct {
TOURL *url.URL
TOUser string
Dir string
+ ViaRelease bool
+ ParentComments bool
}
type TCCfg struct {
@@ -101,6 +103,8 @@ func GetCfg() (Cfg, error) {
revalOnlyPtr := flag.BoolP("revalidate-only", "y", false, "Whether to
exclude files not named 'regex_revalidate.config'")
disableProxyPtr := flag.BoolP("traffic-ops-disable-proxy", "p", false,
"Whether to not use the Traffic Ops proxy specified in the GLOBAL Parameter
tm.rev_proxy.url")
dirPtr := flag.StringP("dir", "D", "", "ATS config directory, used for
config files without location parameters or with relative paths. May be blank.
If blank and any required config file location parameter is missing or
relative, will error.")
+ viaReleasePtr := flag.BoolP("via-string-release", "", false, "Whether
to use the Release value from the RPM package as a replacement for the ATS
version specified in the build that is returned in the Via and Server headers
from ATS.")
+ disableParentConfigComments :=
flag.BoolP("disable-parent-config-comments", "", false, "Disable adding a
comments to parent.config individual lines")
flag.Parse()
@@ -131,6 +135,8 @@ func GetCfg() (Cfg, error) {
revalOnly := *revalOnlyPtr
disableProxy := *disableProxyPtr
dir := *dirPtr
+ viaRelease := *viaReleasePtr
+ parentComments := !(*disableParentConfigComments) //we use this as a
boolean value so reverse it here to not have negative logic
urlSourceStr := "argument" // for error messages
if toURL == "" {
@@ -190,6 +196,8 @@ func GetCfg() (Cfg, error) {
RevalOnly: revalOnly,
DisableProxy: disableProxy,
Dir: dir,
+ ViaRelease: viaRelease,
+ ParentComments: parentComments,
}
if err := log.InitCfg(cfg); err != nil {
return Cfg{}, errors.New("Initializing loggers: " + err.Error()
+ "\n")
diff --git a/traffic_ops_ort/traffic_ops_ort.pl
b/traffic_ops_ort/traffic_ops_ort.pl
index 5677297..72dfeb5 100755
--- a/traffic_ops_ort/traffic_ops_ort.pl
+++ b/traffic_ops_ort/traffic_ops_ort.pl
@@ -44,6 +44,8 @@ my $override_hostname_short = '';
my $to_timeout_ms = 30000;
my $syncds_updates_ipallow = 0;
my $traffic_ops_insecure = 0;
+my $via_string_release = 0;
+my $disable_parent_config_comments = 0;
GetOptions( "dispersion=i" => \$dispersion, # dispersion (in seconds)
"retries=i" => \$retries,
@@ -55,6 +57,8 @@ GetOptions( "dispersion=i" => \$dispersion, #
dispersion (in seconds)
"to_timeout_ms=i" => \$to_timeout_ms,
"syncds_updates_ipallow=i" => \$syncds_updates_ipallow,
"traffic_ops_insecure=i" => \$traffic_ops_insecure,
+ "via_string_release=i" => \$via_string_release,
+ "disable_parent_config_comments=i" =>
\$disable_parent_config_comments,
);
if ( $#ARGV < 1 ) {
@@ -173,6 +177,16 @@ if ($traffic_ops_insecure == 1) {
$atstccfg_insecure_arg = "--traffic-ops-insecure";
}
+my $atstccfg_via_string_release = "";
+if ($via_string_release == 1) {
+ $atstccfg_via_string_release = "--via-string-release";
+}
+
+my $atstccfg_parent_config_comments = "";
+if ($disable_parent_config_comments == 1) {
+ $atstccfg_parent_config_comments = "--disable-parent-config-comments";
+}
+
my $TMP_BASE = "/tmp/ort";
my $LOG_BASE = "/var/log/ort"; # TODO add inferring ORT install location, and
allowing / vs /opt install
@@ -353,6 +367,8 @@ sub usage {
print "\t to_timeout_ms=<time> => the Traffic Ops request
timeout in milliseconds. Default = 30000 (30 seconds).\n";
print "\t syncds_updates_ipallow=<0|1> => Update ip_allow.config in
syncds mode, which may trigger an ATS bug blocking random addresses on load!
Default = 0, only update on badass and restart.\n";
print "\t traffic_ops_insecure=<0|1> => Turns off certificate
checking when connecting to Traffic Ops.\n";
+ print "\t via_string_release=<0|1> => change the ATS via string
to be the rpm release instead of the actual ATS version number\n";
+ print "\t disable_parent_config_comments=<0|1> => do not write
line comments to the parent.config file\n";
print
"====-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-====\n";
exit 1;
}
@@ -792,7 +808,7 @@ sub send_update_to_trops {
$reval_str='true';
}
- my $response = `$atstccfg_cmd $atstccfg_insecure_arg
$atstccfg_timeout_arg $atstccfg_arg_disable_proxy --traffic-ops-user='$TO_USER'
--traffic-ops-password='$TO_PASS' --traffic-ops-url='$TO_URL'
--cache-host-name='$hostname_short' --log-location-error=stderr
--log-location-warning=stderr --log-location-info=null
--set-queue-status=$upd_str --set-reval-status=$reval_str
2>>$atstccfg_log_path`;
+ my $response = `$atstccfg_cmd $atstccfg_insecure_arg
$atstccfg_via_string_release $atstccfg_parent_config_comments
$atstccfg_timeout_arg $atstccfg_arg_disable_proxy --traffic-ops-user='$TO_USER'
--traffic-ops-password='$TO_PASS' --traffic-ops-url='$TO_URL'
--cache-host-name='$hostname_short' --log-location-error=stderr
--log-location-warning=stderr --log-location-info=null
--set-queue-status=$upd_str --set-reval-status=$reval_str
2>>$atstccfg_log_path`;
my $atstccfg_exit_code = $?;
if ($atstccfg_exit_code != 0) {
( $log_level >> $ERROR ) && printf("ERROR sending update status
with atstccfg (via Traffic Ops). See $atstccfg_log_path.\n");
@@ -802,7 +818,7 @@ sub send_update_to_trops {
}
sub get_update_status {
- my $upd_ref = `$atstccfg_cmd $atstccfg_insecure_arg
$atstccfg_timeout_arg $atstccfg_arg_disable_proxy --traffic-ops-user='$TO_USER'
--traffic-ops-password='$TO_PASS' --traffic-ops-url='$TO_URL'
--cache-host-name='$hostname_short' --log-location-error=stderr
--log-location-warning=stderr --log-location-info=null --get-data=update-status
2>>$atstccfg_log_path`;
+ my $upd_ref = `$atstccfg_cmd $atstccfg_insecure_arg
$atstccfg_via_string_release $atstccfg_parent_config_comments
$atstccfg_timeout_arg $atstccfg_arg_disable_proxy --traffic-ops-user='$TO_USER'
--traffic-ops-password='$TO_PASS' --traffic-ops-url='$TO_URL'
--cache-host-name='$hostname_short' --log-location-error=stderr
--log-location-warning=stderr --log-location-info=null --get-data=update-status
2>>$atstccfg_log_path`;
my $atstccfg_exit_code = $?;
if ($atstccfg_exit_code != 0) {
( $log_level >> $ERROR ) && printf("ERROR getting update status
from atstccfg (via Traffic Ops). See $atstccfg_log_path.\n");
@@ -813,7 +829,7 @@ sub get_update_status {
##Some versions of Traffic Ops had the 1.3 API but did not have the
use_reval_pending field. If this field is not present, exit.
if ( !defined( $upd_json->{'use_reval_pending'} ) ) {
- my $info_ref = `$atstccfg_cmd $atstccfg_insecure_arg
$atstccfg_timeout_arg $atstccfg_arg_disable_proxy --traffic-ops-user='$TO_USER'
--traffic-ops-password='$TO_PASS' --traffic-ops-url='$TO_URL'
--cache-host-name='$hostname_short' --log-location-error=stderr
--log-location-warning=stderr --log-location-info=null --get-data=system-info
2>>$atstccfg_log_path`;
+ my $info_ref = `$atstccfg_cmd $atstccfg_insecure_arg
$atstccfg_via_string_release $atstccfg_parent_config_comments
$atstccfg_timeout_arg $atstccfg_arg_disable_proxy --traffic-ops-user='$TO_USER'
--traffic-ops-password='$TO_PASS' --traffic-ops-url='$TO_URL'
--cache-host-name='$hostname_short' --log-location-error=stderr
--log-location-warning=stderr --log-location-info=null --get-data=system-info
2>>$atstccfg_log_path`;
my $atstccfg_exit_code = $?;
if ($atstccfg_exit_code != 0) {
( $log_level >> $ERROR ) && printf("ERROR Unable to get
status of use_reval_pending parameter. Stopping.\n");
@@ -868,7 +884,7 @@ sub check_revalidate_state {
( $log_level >> $ERROR ) && print "ERROR Traffic Ops is
signaling that no revalidations are waiting to be applied.\n";
}
- my $stj = `$atstccfg_cmd $atstccfg_insecure_arg
$atstccfg_timeout_arg $atstccfg_arg_disable_proxy --traffic-ops-user='$TO_USER'
--traffic-ops-password='$TO_PASS' --traffic-ops-url='$TO_URL'
--cache-host-name='$hostname_short' --log-location-error=stderr
--log-location-warning=stderr --log-location-info=null --get-data=statuses
2>>$atstccfg_log_path`;
+ my $stj = `$atstccfg_cmd $atstccfg_insecure_arg
$atstccfg_via_string_release $atstccfg_parent_config_comments
$atstccfg_timeout_arg $atstccfg_arg_disable_proxy --traffic-ops-user='$TO_USER'
--traffic-ops-password='$TO_PASS' --traffic-ops-url='$TO_URL'
--cache-host-name='$hostname_short' --log-location-error=stderr
--log-location-warning=stderr --log-location-info=null --get-data=statuses
2>>$atstccfg_log_path`;
my $atstccfg_exit_code = $?;
if ( $atstccfg_exit_code != 0 ) {
( $log_level >> $ERROR ) && print "Statuses URL:
returned $stj! Skipping creation of status file.\n";
@@ -987,7 +1003,7 @@ sub check_syncds_state {
( $log_level >> $ERROR ) && print "ERROR Traffic Ops is
signaling that no update is waiting to be applied.\n";
}
- my $stj = `$atstccfg_cmd $atstccfg_insecure_arg
$atstccfg_timeout_arg $atstccfg_arg_disable_proxy --traffic-ops-user='$TO_USER'
--traffic-ops-password='$TO_PASS' --traffic-ops-url='$TO_URL'
--cache-host-name='$hostname_short' --log-location-error=stderr
--log-location-warning=stderr --log-location-info=null --get-data=statuses
2>>$atstccfg_log_path`;
+ my $stj = `$atstccfg_cmd $atstccfg_insecure_arg
$atstccfg_via_string_release $atstccfg_parent_config_comments
$atstccfg_timeout_arg $atstccfg_arg_disable_proxy --traffic-ops-user='$TO_USER'
--traffic-ops-password='$TO_PASS' --traffic-ops-url='$TO_URL'
--cache-host-name='$hostname_short' --log-location-error=stderr
--log-location-warning=stderr --log-location-info=null --get-data=statuses
2>>$atstccfg_log_path`;
my $atstccfg_exit_code = $?;
if ( $atstccfg_exit_code != 0 ) {
( $log_level >> $ERROR ) && print "Statuses URL:
returned $stj! Skipping creation of status file.\n";
@@ -1545,7 +1561,7 @@ sub get_cfg_file_list {
$atstccfg_reval_arg = '--revalidate-only';
}
- my $result = `$atstccfg_cmd --dir='$ats_config_dir'
$atstccfg_insecure_arg $atstccfg_timeout_arg $atstccfg_arg_disable_proxy
--traffic-ops-user='$TO_USER' --traffic-ops-password='$TO_PASS'
--traffic-ops-url='$TO_URL' --cache-host-name='$host_name' $atstccfg_reval_arg
--log-location-error=stderr --log-location-warning=stderr
--log-location-info=null 2>>$atstccfg_log_path`;
+ my $result = `$atstccfg_cmd --dir='$ats_config_dir'
$atstccfg_insecure_arg $atstccfg_via_string_release
$atstccfg_parent_config_comments $atstccfg_timeout_arg
$atstccfg_arg_disable_proxy --traffic-ops-user='$TO_USER'
--traffic-ops-password='$TO_PASS' --traffic-ops-url='$TO_URL'
--cache-host-name='$host_name' $atstccfg_reval_arg --log-location-error=stderr
--log-location-warning=stderr --log-location-info=null 2>>$atstccfg_log_path`;
my $atstccfg_exit_code = $?;
if ($atstccfg_exit_code != 0) {
( $log_level >> $ERROR ) && printf("ERROR getting config files
from atstccfg via Traffic Ops. See $atstccfg_log_path for details\n");
@@ -1621,7 +1637,7 @@ sub parse_multipart_config_files {
sub get_header_comment {
my $toolname;
- my $result = `$atstccfg_cmd $atstccfg_insecure_arg
$atstccfg_timeout_arg $atstccfg_arg_disable_proxy --traffic-ops-user='$TO_USER'
--traffic-ops-password='$TO_PASS' --traffic-ops-url='$TO_URL'
--cache-host-name='$hostname_short' --log-location-error=stderr
--log-location-warning=stderr --log-location-info=null --get-data=system-info
2>>$atstccfg_log_path`;
+ my $result = `$atstccfg_cmd $atstccfg_insecure_arg
$atstccfg_via_string_release $atstccfg_parent_config_comments
$atstccfg_timeout_arg $atstccfg_arg_disable_proxy --traffic-ops-user='$TO_USER'
--traffic-ops-password='$TO_PASS' --traffic-ops-url='$TO_URL'
--cache-host-name='$hostname_short' --log-location-error=stderr
--log-location-warning=stderr --log-location-info=null --get-data=system-info
2>>$atstccfg_log_path`;
my $atstccfg_exit_code = $?;
if ($atstccfg_exit_code != 0) {
( $log_level >> $ERROR ) && printf("ERROR Unable to get
system info. Stopping.\n");
@@ -1796,7 +1812,7 @@ sub process_packages {
my $proceed = 0;
- my $result = `$atstccfg_cmd $atstccfg_insecure_arg
$atstccfg_timeout_arg $atstccfg_arg_disable_proxy --traffic-ops-user='$TO_USER'
--traffic-ops-password='$TO_PASS' --traffic-ops-url='$TO_URL'
--cache-host-name='$hostname_short' --log-location-error=stderr
--log-location-warning=stderr --log-location-info=null --get-data=packages
2>>$atstccfg_log_path`;
+ my $result = `$atstccfg_cmd $atstccfg_insecure_arg
$atstccfg_via_string_release $atstccfg_parent_config_comments
$atstccfg_timeout_arg $atstccfg_arg_disable_proxy --traffic-ops-user='$TO_USER'
--traffic-ops-password='$TO_PASS' --traffic-ops-url='$TO_URL'
--cache-host-name='$hostname_short' --log-location-error=stderr
--log-location-warning=stderr --log-location-info=null --get-data=packages
2>>$atstccfg_log_path`;
my $atstccfg_exit_code = $?;
if ($atstccfg_exit_code != 0) {
( $log_level >> $FATAL ) && print "FATAL Error getting package
list from Traffic Ops!\n";
@@ -2042,7 +2058,7 @@ sub process_chkconfig {
my $proceed = 0;
- my $result = `$atstccfg_cmd $atstccfg_insecure_arg
$atstccfg_timeout_arg $atstccfg_arg_disable_proxy --traffic-ops-user='$TO_USER'
--traffic-ops-password='$TO_PASS' --traffic-ops-url='$TO_URL'
--cache-host-name='$hostname_short' --log-location-error=stderr
--log-location-warning=stderr --log-location-info=null --get-data=chkconfig
2>>$atstccfg_log_path`;
+ my $result = `$atstccfg_cmd $atstccfg_insecure_arg
$atstccfg_via_string_release $atstccfg_parent_config_comments
$atstccfg_timeout_arg $atstccfg_arg_disable_proxy --traffic-ops-user='$TO_USER'
--traffic-ops-password='$TO_PASS' --traffic-ops-url='$TO_URL'
--cache-host-name='$hostname_short' --log-location-error=stderr
--log-location-warning=stderr --log-location-info=null --get-data=chkconfig
2>>$atstccfg_log_path`;
my $atstccfg_exit_code = $?;
if ($atstccfg_exit_code != 0) {