def printMachineInfo(): # Log information about the machine. print "Platform details: " + " ".join(platform.uname()) print "hg version: " + sps.captureStdout(['hg', '-q', 'version'])[0] # In here temporarily to see if mock Linux slaves on TBPL have gdb installed try: print "gdb version: " + sps.captureStdout(['gdb', '--version'], combineStderr=True, ignoreStderr=True, ignoreExitCode=True)[0] except (KeyboardInterrupt, Exception) as e: print 'Error involving gdb is: ' + repr(e) # FIXME: Should have if os.path.exists(path to git) or something # print "git version: " + sps.captureStdout(['git', 'version'], combineStderr=True, ignoreStderr=True, ignoreExitCode=True)[0] print "Python version: " + sys.version.split()[0] print "Number of cores visible to OS: " + str(multiprocessing.cpu_count()) print 'Free space (GB): ' + str('%.2f') % sps.getFreeSpace('/', 3) hgrcLocation = os.path.join(path0, '.hg', 'hgrc') if os.path.isfile(hgrcLocation): print 'The hgrc of this repository is:' with open(hgrcLocation, 'rb') as f: hgrcContentList = f.readlines() for line in hgrcContentList: print line.rstrip() if os.name == 'posix': # resource library is only applicable to Linux or Mac platforms. import resource print "Corefile size (soft limit, hard limit) is: " + \ repr(resource.getrlimit(resource.RLIMIT_CORE))
def printMachineInfo(): # Log information about the machine. print "Platform details: " + " ".join(platform.uname()) print "hg version: " + sps.captureStdout(['hg', '-q', 'version'])[0] # In here temporarily to see if mock Linux slaves on TBPL have gdb installed try: print "gdb version: " + sps.captureStdout(['gdb', '--version'], combineStderr=True, ignoreStderr=True, ignoreExitCode=True)[0] except (KeyboardInterrupt, Exception) as e: print('Error involving gdb is: ' + repr(e)) # FIXME: Should have if os.path.exists(path to git) or something #print "git version: " + sps.captureStdout(['git', 'version'], combineStderr=True, ignoreStderr=True, ignoreExitCode=True)[0] print "Python version: " + sys.version.split()[0] print "Number of cores visible to OS: " + str(multiprocessing.cpu_count()) print 'Free space (GB): ' + str('%.2f') % sps.getFreeSpace('/', 3) hgrcLocation = os.path.join(path0, '.hg', 'hgrc') if os.path.isfile(hgrcLocation): print 'The hgrc of this repository is:' with open(hgrcLocation, 'rb') as f: hgrcContentList = f.readlines() for line in hgrcContentList: print line.rstrip() if os.name == 'posix': # resource library is only applicable to Linux or Mac platforms. import resource print "Corefile size (soft limit, hard limit) is: " + \ repr(resource.getrlimit(resource.RLIMIT_CORE))