Exemplo n.º 1
0
 def assignRequest(self,url,workflow,team,site,args={}):
     params = {"action": "Assign",
               "Team"+team: "checked",
               "SiteWhitelist": [],
               "SiteBlacklist": [],
               "MergedLFNBase": "/store/user",
               "UnmergedLFNBase": "/store/temp/user",
               "MinMergeSize": 1,
               "MaxMergeSize": 1,
               "MaxMergeEvents": 50000,
               #"AcquisitionEra": era,
               "maxRSS": 4294967296,
               "maxVSize": 4294967296,
               "dashboard": "CMSYAATAnalysis",
               "checkbox"+workflow: "checked"}
 
     request = JSONRequests(url)
     headers  =  {"Content-type": "application/x-www-form-urlencoded",
              "Accept": "text/plain"}
     request.post("/reqmgr/assign/handleAssignmentPage", params, headers)
     
     (data, status, reason, _) = request.getresponse()
     if status != 200:
         self.debugHttpError(data, status, reason)            
         raise RuntimeError, "POST failed with code %s" % status
     self.logger.info("Assigned the workflow %s" % workflow)
     
Exemplo n.º 2
0
 def approveRequest(self, url,workflow):
     params = {"requestName": workflow,              "status": "assignment-approved"}
     request = JSONRequests(url)
     headers  =  {"Content-type": "application/x-www-form-urlencoded",
              "Accept": "text/plain"}
     request.put("/reqmgr/reqMgr/request", params, headers)
     
     (data, status, reason, _) = request.getresponse()
     if status != 200:
         self.debugHttpError(data, status, reason)            
         raise RuntimeError, "PUT failed with code %s" % status
     self.logger.info("Approved the workflow %s" % workflow)
Exemplo n.º 3
0
    def makeRequest(self, url, params):
        request = JSONRequests(url)
        headers  =  {"Content-type": "application/x-www-form-urlencoded",
                 "Accept": "text/plain"}

        request.post("/reqmgr/create/makeSchema", params, headers)
    
        (data, status, reason, _) = request.getresponse()
        if status != 303:
            self.debugHttpError(data, status, reason)            
            raise RuntimeError, "POST failed with code %s" % status
            
        workflow=data.split("'")[1].split('/')[-1]
        self.logger.info('Injected workflow:',workflow,'into',url)
        return workflow