예제 #1
0
def chkDataAggr(args,tb_ac):
    rc = 0
    log.info('Checking aggregates for %d tables' % len(tb_ac))
    for tb,ac in tb_ac:
       log.debug('Table = %s Aggr Col = %s' % (tb,ac))
       if len(ac.strip()) < 1 :
           log.error('table %s invalid Aggr Col %s' % (tb,ac))
           rc+=1
           continue
       
       tgt_out = _getNZSum(args,tb,ac)
       tgt_sum = su.toFloat(tgt_out)
       log.debug('tgt_out = %s tgt_sum %s' % (tgt_out,tgt_sum))
       src_out = _getGPSum(args,tb,ac)
       src_sum = su.toFloat(src_out)
       log.debug('src_out = %s src_sum %s' % (src_out,src_sum))
       if (tgt_sum is None or src_sum is None):
          log.error('Got Inv Number for tbl = %s aggr col = %s tgt_sum = %s  src_sum = %s ' % (tb,ac, tgt_sum,src_sum))
          continue
       d = tgt_sum - src_sum
       if d != 0.0:
          log.error('tbl = %s aggr col = %s diff = %s ' % (tb,ac,d))
          log.error('GP = %s\t NZ = %s ' % (src_sum,tgt_sum))
          rc+=1
       else : log.info('SUM OK for tbl = %s aggr col = %s' % (tb,ac)) 
    return rc   
예제 #2
0
 def _setConnParam(self):
     #rc = _BaseFT._getFtpEnvVars(self)   
     rc = self._getFtpEnvVars()   
     if rc != 0 : return rc
     ftpVerb = su.toInt(self.ftpVerb)
     if ftpVerb is None: 
         self.log.error('FTP_VERB %s needs to be an integer. Setting to default %d' % (self.ftpVerb,FTP_VERBOSE))
         self.ftpVerb  = FTP_VERBOSE
     else: 
         self.ftpVerb  = 0 if ( ftpVerb < 0 or ftpVerb > 2 ) else ftpVerb
         self.log.debug('FTP_VERB : %d ' % self.ftpVerb)
         
     ftpPort = su.toInt(self.ftpPort)
     if ftpPort is None: 
         self.log.error('FTP_PORT : %s needs to be an integer.Setting to Default %d ' % (self.ftpPort,FTP_PORT))
         self.ftpPort  = FTP_PORT                
     else:
         self.ftpPort = ftpPort
         self.log.debug('FTP_PORT : %s' % (self.ftpPort))
                            
     ftpTimeout = su.toFloat(self.ftpTimeout)
     if ftpTimeout is None: 
         self.ftpTimeout = FTP_TIMEOUT
         self.log.error('FTP_TIMEOUT : %s needs to be a float .Setting to Default %s' % (self.ftpTimeout, FTP_TIMEOUT))              
     else:
         self.ftpTimeout = ftpTimeout
         self.log.debug('FTP_TIMEOUT : %s' % (self.ftpTimeout))
     return rc