示例#1
0
def _raiseCheckInError(request, ex, msg):
    """
    Private function called only from this module.
    Always from the except exception block - the traceback
    is put in the local log file.

    """
    requestName = request['RequestName']
    msg +='\n' + str(ex)
    msg += "\nUnable to check in new request %s" % requestName

    reqId = GetRequest.requestID(requestName)
    # make absolutely sure you're deleting the right one
    oldReqId = request['RequestID']
    if reqId:
        # make absolutely sure you're deleting the right one
        oldReqId = request['RequestID']
        if oldReqId != reqId:
            raise RequestCheckInError("Bad state deleting request %s/%s.  Please contact a ReqMgr administrator" % (oldReqId/ reqId))
        else:
            RequestAdmin.deleteRequest(reqId)
    # get information about the last exception
    trace = traceback.format_exception(*sys.exc_info())
    traceString = ''.join(trace)
    logging.error("%s\n%s" % (msg, traceString))
    raise RequestCheckInError(msg)
示例#2
0
def _raiseCheckInError(request, ex, msg):
    """
    Private function called only from this module.
    Always from the except exception block - the traceback
    is put in the local log file.

    """
    requestName = request['RequestName']
    msg += '\n' + str(ex)
    msg += "\nUnable to check in new request %s" % requestName

    reqId = GetRequest.requestID(requestName)
    # make absolutely sure you're deleting the right one
    oldReqId = request['RequestID']
    if reqId:
        # make absolutely sure you're deleting the right one
        oldReqId = request['RequestID']
        if oldReqId != reqId:
            raise RequestCheckInError(
                "Bad state deleting request %s/%s.  Please contact a ReqMgr administrator"
                % (oldReqId / reqId))
        else:
            RequestAdmin.deleteRequest(requestName)
    # get information about the last exception
    trace = traceback.format_exception(*sys.exc_info())
    traceString = ''.join(trace)
    logging.error("%s\n%s" % (msg, traceString))
    raise RequestCheckInError(msg)
示例#3
0
def raiseCheckInError(request, ex, msg):
    requestName = request['RequestName']
    msg +='\n' + str(ex)
    msg += "\nUnable to check in new request %s" % requestName

    reqId = GetRequest.requestID(requestName)
    # make absolutely sure you're deleting the right one
    oldReqId = request['RequestID']
    if reqId:
       # make absolutely sure you're deleting the right one
       oldReqId = request['RequestID']
       if oldReqId != reqId:
           raise RuntimeError, "Bad state deleting request %s/%s.  Please contact a ReqMgr administrator" % (oldReqId/ reqId)
       else:
           RequestAdmin.deleteRequest(reqId)
    raise RuntimeError, msg
示例#4
0
    def deleteRequest(self, requestName):
        """
        Deletes a request from the ReqMgr MySQL/Oracle database
        and also from CoucDB.
        
        """
        # 404 will be thrown automatically on a non-existing request
        request = self.getRequest(requestName)
        helper = Utilities.loadWorkload(request)
        couchDocId = requestName
        helper.deleteCouch(self.couchUrl, self.workloadDBName, couchDocId)

        # #4289 - Request delete operation deletes the request from
        # MySQL/Oracle but not from CouchDB, fix here
        # Seangchan shall also fix here deleting such requests from WMStats (#4398)

        RequestAdmin.deleteRequest(requestName)
        return
示例#5
0
    def deleteRequest(self, requestName):
        """
        Deletes a request from the ReqMgr MySQL/Oracle database
        and also from CoucDB.
        
        """
        # 404 will be thrown automatically on a non-existing request
        request = self.getRequest(requestName)
        helper = Utilities.loadWorkload(request)
        couchDocId = requestName
        helper.deleteCouch(self.couchUrl, self.workloadDBName, couchDocId)

        # #4289 - Request delete operation deletes the request from
        # MySQL/Oracle but not from CouchDB, fix here
        # Seangchan shall also fix here deleting such requests from WMStats (#4398)

        RequestAdmin.deleteRequest(requestName)
        return
示例#6
0
 def deleteRequest(self, requestName):
     """ Deletes a request from the ReqMgr """
     request = self.findRequest(requestName)
     if request == None:
         raise cherrypy.HTTPError(404, "No such request")
     return RequestAdmin.deleteRequest(request['RequestID'])
示例#7
0
 def deleteRequest(self, requestName):
     """ Deletes a request from the ReqMgr """
     request = self.findRequest(requestName)
     if request == None:
         raise cherrypy.HTTPError(404, "No such request")
     return RequestAdmin.deleteRequest(request['RequestID'])