diff --git a/src/python/Utils/PortForward.py b/src/python/Utils/PortForward.py index 05f30a2be3..8aa3e6e068 100644 --- a/src/python/Utils/PortForward.py +++ b/src/python/Utils/PortForward.py @@ -51,12 +51,12 @@ def portMangle(callObj, url, *args, **kwargs): forwarded = False try: if isinstance(url, str): - urlToMangle = u'https://cmsweb' + urlToMangle = u'https://tivanov' if url.startswith(urlToMangle): newUrl = url.replace(u'.cern.ch/', u'.cern.ch:%d/' % port, 1) forwarded = True elif isinstance(url, bytes): - urlToMangle = b'https://cmsweb' + urlToMangle = b'https://tivanov' if url.startswith(urlToMangle): newUrl = url.replace(b'.cern.ch/', b'.cern.ch:%d/' % port, 1) forwarded = True diff --git a/src/python/WMComponent/AgentStatusWatcher/AgentStatusPoller.py b/src/python/WMComponent/AgentStatusWatcher/AgentStatusPoller.py index cf45cdd418..04eb78cc86 100644 --- a/src/python/WMComponent/AgentStatusWatcher/AgentStatusPoller.py +++ b/src/python/WMComponent/AgentStatusWatcher/AgentStatusPoller.py @@ -14,6 +14,7 @@ from pprint import pformat from Utils.Timers import timeFunction from Utils.Utilities import numberCouchProcess +from Utils.PortForward import PortForward from WMComponent.AgentStatusWatcher.DrainStatusPoller import DrainStatusPoller from WMComponent.AnalyticsDataCollector.DataCollectAPI import WMAgentDBData, initAgentInfo from WMCore.Credential.Proxy import Proxy @@ -54,6 +55,9 @@ def __init__(self, config): self.credThresholds = {'proxy': {'error': 3, 'warning': 5}, 'certificate': {'error': 10, 'warning': 20}} + # create a portForwarder to be used for rerouting the replication process + self.portForwarder = PortForward(8443) + # Monitoring setup self.userAMQ = getattr(config.AgentStatusWatcher, "userAMQ", None) self.passAMQ = getattr(config.AgentStatusWatcher, "passAMQ", None) @@ -77,6 +81,7 @@ def setUpCouchDBReplication(self): # set up common replication code wmstatsSource = self.config.JobStateMachine.jobSummaryDBName wmstatsTarget = self.config.General.centralWMStatsURL + wmstatsTarget = self.portForwarder(wmstatsTarget) self.replicatorDocs.append({'source': wmstatsSource, 'target': wmstatsTarget, 'filter': "WMStatsAgent/repfilter"}) @@ -89,7 +94,9 @@ def setUpCouchDBReplication(self): # set up workqueue replication wqfilter = 'WorkQueue/queueFilter' parentQURL = self.config.WorkQueueManager.queueParams["ParentQueueCouchUrl"] + parentQURL = self.portForwarder(parentQURL) childURL = self.config.WorkQueueManager.queueParams["QueueURL"] + childURL = self.portForwarder(childURL) query_params = {'childUrl': childURL, 'parentUrl': sanitizeURL(parentQURL)['url']} localQInboxURL = "%s_inbox" % self.config.AnalyticsDataCollector.localQueueURL self.replicatorDocs.append({'source': sanitizeURL(parentQURL)['url'], 'target': localQInboxURL,