def pingDB(self) : rc = 1 cmd = 'tnsping %s ' % self.ib.db_name rc, msg = p.runSync(cmd, self.logger) if rc == 0 : rc = su.findStr(msg,'OK ') return rc
def connInfaRepo(): rv = -1 cmdRepo = ic.PMRep(ib,log) rc,rm = cmdRepo.repConn() if (rc == 0): rv = su.findStr(rm,'connect completed successfully') log.debug('rc=%s rm = %s' % (rc,rm)) return rv
def ftpRenFile(self, renFiles): rc = 0 if len(renFiles) < 1: self.log.error('No files has been specified to rename') return 1 pwd = self.ftp.pwd() self.log.debug('rename File list', renFiles) for ele in renFiles: sfn,dfn = ele sf = '%s/%s' % (pwd,sfn) tf = '%s/%s' % (pwd,dfn) rv = self._ftpRenFile(sf,tf) r = su.findStr(rv,'250') if r != 0 : rc+=r self.log.debug('rv = %s r = %s' % (rv,r)) return rc