def run(self): while 1: print "listener: waiting for socket accept..." (clientsocket, (host, port)) = serversocket.accept() print "listener: got connection: %s on %s:%d" % (clientsocket, host, port) path = "%s/%d" % (rootDir, port) if os.path.isdir(path): shutil.rmtree(path) os.makedirs(path) zipFileName = os.path.join(path, "tmp.zip") pkgutil.getDataFile(clientsocket, zipFileName) print "listener: uncompressing %s from %s" % (path, zipFileName) pkgutil.uncompress(zipFileName, path) os.remove(zipFileName) taskDef = (task, path, host) print "listener: aquiring lock for task push" waitCondition.acquire() pendingTasks.append(taskDef) print "listener: aquiring lock for notify/release after task push" waitCondition.notify() waitCondition.release()
def waitForResponse(): packagesRemaining = options.binaryPackageCount pkgutil.debug("Waiting for build server responses...") while packagesRemaining: displayStatus() (sock, (host, port)) = serversocket.accept() pkgutil.debug(" - got response from %s:%d" % (host, port)) match = False for pkg in packages: if pkg.binary and socket.gethostbyname(pkg.buildServer) == host and not pkg.done: pkg.done = True pkg.dataFile = options.packageRoot + "/" + pkg.name() + ".zip" pkgutil.getDataFile(sock, pkg.dataFile) pkgutil.debug(" - uncompressing to %s" % (pkg.packageDir)) pkgutil.uncompress(pkg.dataFile, pkg.packageDir); try: postProcessPackage(pkg) except: traceback.print_exc() packagesRemaining = packagesRemaining - 1 match = True break if not match: print " - unknown host... %s" % host displayStatus()
def waitForResponse(): packagesRemaining = len(servers) pkgutil.debug("Waiting for build server responses...") while packagesRemaining: (sock, (host, port)) = serversocket.accept() pkgutil.debug(" - got response from %s:%d" % (host, port)) match = False for server in servers: if socket.gethostbyname(server.host) == host: dataFile = options.packageRoot + "/" + server.host + ".zip" outDir = options.packageRoot + "/" + server.host pkgutil.getDataFile(sock, dataFile) pkgutil.debug(" - uncompressing to %s" % outDir) pkgutil.uncompress(dataFile, outDir) if os.path.isfile(outDir + "/FATAL.ERROR"): print "Build server: %s Failed!!!!" % server.host else: print "Build server: %s ok!" % server.host match = True if match: packagesRemaining = packagesRemaining - 1
def waitForResponse(): packagesRemaining = len(servers) pkgutil.debug("Waiting for build server responses...") while packagesRemaining: (sock, (host, port)) = serversocket.accept() pkgutil.debug(" - got response from %s:%d" % (host, port)) match = False for server in servers: if socket.gethostbyname(server.host) == host: dataFile = options.packageRoot + "/" + server.host + ".zip" outDir = options.packageRoot + "/" + server.host; pkgutil.getDataFile(sock, dataFile) pkgutil.debug(" - uncompressing to %s" % outDir) pkgutil.uncompress(dataFile, outDir); if os.path.isfile(outDir + "/FATAL.ERROR"): print "Build server: %s Failed!!!!" % server.host else: print "Build server: %s ok!" % server.host match = True if match: packagesRemaining = packagesRemaining - 1