Ejemplo n.º 1
0
    def listRequests(self):
        """
        Returns a list of requests in the reqmgr

        TODO add generator form
        """
        reqmgr = RequestManagerImpl()
        retval = []
        for request in reqmgr.listRequests(self.endpoint):
            tmpRequest = Request()
            tmpRequest.setReqmgrUrl( self.endpoint )
            tmpRequest.setWorkflowName( request['request_name'] )
            retval.append( tmpRequest )
        return retval
Ejemplo n.º 2
0
 def submitRequest(self, request):
     """
     Given a request object, submit it to the reqmgr
     
     Returns a new request object initialized with the new remote ID
     """
     reqmgr = RequestManagerImpl()
     workflow = reqmgr.makeRequest( self.endpoint, request.getRequestDict() )
     workflowName = workflow['RequestName']
     reqmgr.approveRequest( self.endpoint, workflow )
     reqmgr.assignRequest( self.endpoint, workflow, request.getTargetTeam() )
     request.setWorkflowName( workflowName )
     return request