This is an automated email from the ASF dual-hosted git repository.

neuman 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 2d476cf  Fix t3c reload and updPending unset (#5583)
2d476cf is described below

commit 2d476cf2a8e1302bb585e5d5364b960cd73d8eee
Author: Robert O Butts <[email protected]>
AuthorDate: Mon Mar 15 10:46:09 2021 -0600

    Fix t3c reload and updPending unset (#5583)
    
    Fixes t3c to do an ATS Reload and un-set the update-pending flag
    for various things that need them, matching ort.pl.
---
 traffic_ops_ort/t3c/torequest/torequest.go | 39 +++++++++++++++---------------
 1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/traffic_ops_ort/t3c/torequest/torequest.go 
b/traffic_ops_ort/t3c/torequest/torequest.go
index 305be62..46390fd 100644
--- a/traffic_ops_ort/t3c/torequest/torequest.go
+++ b/traffic_ops_ort/t3c/torequest/torequest.go
@@ -680,26 +680,27 @@ func (r *TrafficOpsReq) replaceCfgFile(cfg *ConfigFile) 
error {
                _, err = r.writeCfgFile(cfg, "", data)
                if err != nil {
                        return errors.New("Failed to write the new config file: 
" + err.Error())
-               } else {
-                       cfg.ChangeApplied = true
-                       if cfg.RemapPluginConfig == true { // trafficserver 
config reload is required
-                               r.TrafficCtlReload = true
-                               r.RemapConfigReload = true
-                       }
-                       if cfg.Name == "plugin.config" { // trafficserver 
restart is required
-                               r.TrafficServerRestart = true
-                       } else if cfg.Name == "remap.config" {
-                               r.TrafficCtlReload = true
-                               r.RemapConfigReload = true
-                       } else if cfg.Name == "sysctl.conf" { // sysctl reload 
is required
-                               r.SysCtlReload = true
-                       } else if cfg.Name == "ssl_multicert.config" {
-                               r.TrafficCtlReload = true
-                       } else if cfg.Name == "ntpd.conf" { // ntpd reload is 
required
-                               r.NtpdRestart = true
-                       }
-                       log.Debugf("Setting change applied for '%s'\n", 
cfg.Name)
                }
+               cfg.ChangeApplied = true
+
+               r.TrafficCtlReload = r.TrafficCtlReload ||
+                       strings.HasSuffix(cfg.Dir, "trafficserver") ||
+                       cfg.RemapPluginConfig ||
+                       cfg.Name == "remap.config" ||
+                       cfg.Name == "ssl_multicert.config" ||
+                       strings.HasPrefix(cfg.Name, "url_sig_") ||
+                       strings.HasPrefix(cfg.Name, "uri_signing") ||
+                       strings.HasPrefix(cfg.Name, "hdr_rw_") ||
+                       (strings.HasSuffix(cfg.Dir, "ssl") && 
strings.HasSuffix(cfg.Name, ".cer")) ||
+                       (strings.HasSuffix(cfg.Dir, "ssl") && 
strings.HasSuffix(cfg.Name, ".key"))
+
+               r.TrafficServerRestart = cfg.Name == "plugin.config"
+               r.RemapConfigReload = cfg.RemapPluginConfig || cfg.Name == 
"remap.config"
+               r.NtpdRestart = cfg.Name == "ntpd.conf"
+               r.SysCtlReload = cfg.Name == "sysctl.conf"
+
+               log.Debugf("Setting change applied for '%s'\n", cfg.Name)
+
        } else {
                log.Infof("You elected not to replace %s with the version from 
Traffic Ops.\n", cfg.Name)
                cfg.ChangeApplied = false

Reply via email to