You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2019/04/01 16:15:28 UTC
[trafficcontrol] branch master updated: ORT.py now implements a
REVALIDATE mode that only updates configuration files relevant to content
invalidation. (#3371)
This is an automated email from the ASF dual-hosted git repository.
mitchell852 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 7bfb65e ORT.py now implements a REVALIDATE mode that only updates configuration files relevant to content invalidation. (#3371)
7bfb65e is described below
commit 7bfb65e1aa05cbc81396817542c007e5b45c3071
Author: ocket8888 <oc...@gmail.com>
AuthorDate: Mon Apr 1 10:15:22 2019 -0600
ORT.py now implements a REVALIDATE mode that only updates configuration files relevant to content invalidation. (#3371)
* ORT.py now implements a REVALIDATE mode that only updates configuration files relevant to content invalidation.
* Fixed missing string format escape sequence
---
.../cdn-in-a-box/ort/traffic_ops_ort/__init__.py | 4 ++--
.../ort/traffic_ops_ort/main_routines.py | 3 +++
.../cdn-in-a-box/ort/traffic_ops_ort/services.py | 23 +++++++++++-----------
3 files changed, 17 insertions(+), 13 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 89586c7..ed6b3b1 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
@@ -116,8 +116,8 @@ Arguments and Flags
Runs as though the mode was BADASS, but asks the user for confirmation before making changes
REVALIDATE
Will not restart Apache Traffic Server, install packages, or enable/disable system services
- and will exit immediately if this server does not have revalidations pending. Otherwise, the
- same as BADASS.
+ and will exit immediately if this server does not have revalidations pending. Also, the only
+ configuration file that will be updated is `regex_revalidate.config`.
SYNCDS
Will not restart Apache Traffic Server, and will exit immediately if this server does not
have updates pending. Otherwise, the same as BADASS
diff --git a/infrastructure/cdn-in-a-box/ort/traffic_ops_ort/main_routines.py b/infrastructure/cdn-in-a-box/ort/traffic_ops_ort/main_routines.py
index b94794c..b2fa53c 100644
--- a/infrastructure/cdn-in-a-box/ort/traffic_ops_ort/main_routines.py
+++ b/infrastructure/cdn-in-a-box/ort/traffic_ops_ort/main_routines.py
@@ -260,6 +260,9 @@ def processConfigurationFiles(conf:Configuration) -> bool:
for file in myFiles:
try:
file = config_files.ConfigFile(file, conf.TOURL)
+ if conf.mode is conf.Modes.REVALIDATE and file.fname != "regex_revalidate.config":
+ logging.info("Skipping file %s because is not a revalidation file", file.fname)
+ continue
logging.info("\n============ Processing File: %s ============", file.fname)
if file.update(conf) and file.fname in services.FILES_THAT_REQUIRE_RELOADS:
services.NEEDED_RELOADS.add(services.FILES_THAT_REQUIRE_RELOADS[file.fname])
diff --git a/infrastructure/cdn-in-a-box/ort/traffic_ops_ort/services.py b/infrastructure/cdn-in-a-box/ort/traffic_ops_ort/services.py
index 402806c..a48c432 100644
--- a/infrastructure/cdn-in-a-box/ort/traffic_ops_ort/services.py
+++ b/infrastructure/cdn-in-a-box/ort/traffic_ops_ort/services.py
@@ -136,17 +136,18 @@ def restartService(service:str, conf:Configuration) -> bool:
return True
#: A big ol' map of filenames to the services which require reloads when said files change
-FILES_THAT_REQUIRE_RELOADS = {"records.config": reloadATSConfigs,
- "remap.config": reloadATSConfigs,
- "parent.config": reloadATSConfigs,
- "cache.config": reloadATSConfigs,
- "hosting.config": reloadATSConfigs,
- "astats.config": reloadATSConfigs,
- "logs_xml.config": reloadATSConfigs,
- "ssl_multicert.config": reloadATSConfigs,
- "plugin.config": restartATS,
- "ntpd.conf": partial(restartService, "ntpd"),
- "50-ats.rules": restartATS}
+FILES_THAT_REQUIRE_RELOADS = {"records.config": reloadATSConfigs,
+ "remap.config": reloadATSConfigs,
+ "parent.config": reloadATSConfigs,
+ "cache.config": reloadATSConfigs,
+ "hosting.config": reloadATSConfigs,
+ "astats.config": reloadATSConfigs,
+ "logs_xml.config": reloadATSConfigs,
+ "ssl_multicert.config": reloadATSConfigs,
+ "regex_revalidate.config": reloadATSConfigs,
+ "plugin.config": restartATS,
+ "ntpd.conf": partial(restartService, "ntpd"),
+ "50-ats.rules": restartATS}
def doReloads(conf:Configuration) -> bool:
"""