Example #1
0
 def __fileRetry(self,prodid,mode):
   callback = {}
   RPC = RPCClient('Transformation/TransformationManager')
   if mode == "proc":
     res = RPC.getTransformationFilesCount(prodid,"ErrorCount",{'Status':'Processed'})
   elif mode == "not":
     res = RPC.getTransformationFilesCount(prodid,"ErrorCount",{'Status':['Unused','Assigned','Failed']})
   elif mode == "all":
     res = RPC.getTransformationFilesCount(prodid,"ErrorCount")
   else:
     return {"success":"false","error":res["Message"]}
   if not res['OK']:
     callback = {"success":"false","error":res["Message"]}
   else:
     resList = []
     total = res['Value'].pop('Total')
     if total == 0:
       callback = {"success":"false","error":"No files found"}
     else:
       for status in sortList(res['Value'].keys()):
         count = res['Value'][status]
         percent = "%.1f" % ((count*100.0)/total)
         resList.append((status,str(count),percent))
       resList.append(('Total',total,'-'))
       callback = {"success":"true","result":resList}
   gLogger.info("#######",res)
   return callback
Example #2
0
 def __transformationFileStatus(self, id):
   callback = {}
   RPC = RPCClient('Transformation/TransformationManager')
   res = RPC.getTransformationFilesCount(id,"Status")
   if not res['OK']:
     callback = {"success":"false","error":res["Message"]}
   else:
     resList = []
     total = res['Value'].pop('Total')
     if total == 0:
       callback = {"success":"false","error":"No files found"}
     else:
       for status in sortList(res['Value'].keys()):
         count = res['Value'][status]
         percent = "%.1f" % ((count*100.0)/total)
         resList.append((status,str(count),percent))
       resList.append(('Total',total,'-'))
       callback = {"success":"true","result":resList}
   gLogger.info("#######",res)
   return callback