def getSiteInfoFromGlobalQueue(serviceURL): url, dbName = splitCouchServiceURL(serviceURL) globalQ = WorkQueue(url, dbName) try: queues = globalQ.getChildQueues() except Exception, ex: errorInfo = {} errorInfo['site_name'] = serviceURL return [errorInfo]
def getSiteInfoFromLocalQueue(serviceURL): """ get agent status from local agent """ url, dbName = splitCouchServiceURL(serviceURL) wqService = WorkQueue(url, dbName) try: wmbsUrls = wqService.getWMBSUrl() except Exception, ex: errorInfo = {} errorInfo['site_name'] = serviceURL return [errorInfo]
def getRequestInfoFromLocalQueue(serviceURL): """ get the request info from local queue """ url, dbName = splitCouchServiceURL(serviceURL) service = WorkQueue(url, dbName) try: wmbsUrls = service.getWMBSUrl() jobStatusInfo = service.getJobInjectStatusByRequest() except Exception, ex: logging.error("%s: %s"(serviceURL, str(ex))) return DFormatter.errorFormatter(serviceURL, "LocalQueue Down")
def getAgentInfoFromGlobalQueue(serviceURL): url, dbName = splitCouchServiceURL(serviceURL) globalQ = WorkQueue(url, dbName) try: childQueues = globalQ.getChildQueues() except Exception, ex: errorInfo = {} errorInfo['url'] = serviceURL errorInfo['status'] = "Global Queue down: %s" % serviceURL errorInfo['acdc'] = 'N/A' return [errorInfo]
def getAgentInfoFromLocalQueue(serviceURL): """ get agent status from local agent """ url, dbName = splitCouchServiceURL(serviceURL) localQ = WorkQueue(url, dbName) try: wmbsUrl = localQ.getWMBSUrl() except Exception, ex: errorInfo = {} errorInfo['url'] = serviceURL errorInfo['status'] = "Local Queue down: %s" % serviceURL errorInfo['acdc'] = 'N/A' return errorInfo
def getRequestInfoFromGlobalQueue(serviceURL): """ get the request info from global queue """ url, dbName = splitCouchServiceURL(serviceURL) service = WorkQueue(url, dbName) try: jobInfo = service.getTopLevelJobsByRequest() qInfo = service.getChildQueuesByRequest() siteWhitelists = service.getSiteWhitelistByRequest() childQueueURLs = set() for item in qInfo: childQueueURLs.add(item["local_queue"]) except Exception, ex: logging.error("%s: %s"(serviceURL, str(ex))) return DFormatter.errorFormatter(serviceURL, "GlobalQueue Down")