def processData(eInfo, mInfo, sInfo, testMode, verbose, opt=None): if mInfo: try: resIdx = ResourceIndex() Hardware.getHardwareInfo(resIdx, mInfo.machineFile) writeList = resIdx.PTdF() f = open(mInfo.machinePTdF, 'w') for w in writeList: f.write(w) f.close() print "PTDF machine data generation complete." except PTexception, a: raise if testMode: print a raise PTexception(a) else: print a.value return -1
if sInfo: ptds = None try: resIdx = ResourceIndex() ptds = connectToDB(testMode, opt) ## set the machine name from command line arg: fullname, type = getMachineName(ptds, sInfo.machineName, "machine") mach = Resource(fullname, type) resIdx.addResource(mach) parsePerf.getSysPerfInfo(resIdx, sInfo.dataDir, sInfo.perfTools, ptds) ptdfname = sInfo.dataDir + "/sys.ptdf" f = open(ptdfname, 'w') # ResourceIndex.PTdF returns a list of strings to write writeLst = resIdx.PTdF() for w in writeLst: f.write(w) f.close() print "PTDF system data generation complete." except PTexception, a: if testMode: print a.value raise PTexception(a) else: print a.value return -1 else: ptds.closeDB() if eInfo: