mitchell852 closed pull request #3142: Configuration file route generation
script now works with restructured ATC client
URL: https://github.com/apache/trafficcontrol/pull/3142
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/testing/compare/genConfigRoutes.py
b/traffic_ops/testing/compare/genConfigRoutes.py
index 35d414d3f..7317ba433 100755
--- a/traffic_ops/testing/compare/genConfigRoutes.py
+++ b/traffic_ops/testing/compare/genConfigRoutes.py
@@ -36,17 +36,16 @@
#: An absolute path to the Traffic Ops python packages (This assumes that the
script is run from
#: within the repository's normal directory structure)
-TO_LIBS_PATH = os.path.join(ROOT, "traffic_control", "clients", "python",
"trafficops")
+TO_LIBS_PATH = os.path.join(ROOT, "traffic_control", "clients", "python")
sys.path.insert(0, TO_LIBS_PATH)
-sys.path.insert(0, os.path.join(TO_LIBS_PATH, "trafficops"))
from trafficops.tosession import TOSession
-from common.restapi import LoginError, OperationError, InvalidJSONError
+from trafficops.restapi import LoginError, OperationError, InvalidJSONError
#: A format specifier for logging output. Propagates to all imported modules.
LOG_FMT = "%(levelname)s: %(asctime)s line %(lineno)d in
%(module)s.%(funcName)s: %(message)s"
-__version__ = "2.0.0"
+__version__ = "2.0.0-1"
def getConfigRoutesForServers(servers:typing.List[dict], inst:TOSession) \
->
typing.Generator[str, None, None]:
@@ -62,7 +61,7 @@ def getConfigRoutesForServers(servers:typing.List[dict],
inst:TOSession) \
for server in servers:
try:
yield "/api/1.3/servers/%s/configfiles/ats" %
server.hostName
- for file in
inst.getServerConfigFiles(servername=server.hostName)[0].configFiles:
+ for file in
inst.get_server_config_files(host_name=server.hostName)[0].configFiles:
if "apiUri" in file:
yield file.apiUri
else:
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services