def main(): global progTable lu.log("Starting Master.") progTable = ProgTable() master = Master() broadcastListener = lu.nodeDiscovery("Lambda-M", master.getPorts()) lu.log("Initialized")
def main(): checkDependencies("unzip") # make a friendly minion to work for you myMinion = Minion() global minionID minionID = myMinion.ID lu.log(myMinion) # start broadcasting his address while ( not myMinion.getPorts()[0][1] ): time.sleep(.5) broadcaster = lu.nodeDiscovery("Lambda-m." + myMinion.ID, myMinion.getPorts() ) lu.log("Initialized")
def main(): checkDependencies("unzip") # make a friendly minion to work for you myMinion = Minion() global minionID minionID = myMinion.ID lu.log(myMinion) # start broadcasting his address while (not myMinion.getPorts()[0][1]): time.sleep(.5) broadcaster = lu.nodeDiscovery("Lambda-m." + myMinion.ID, myMinion.getPorts()) lu.log("Initialized")
if not os.path.exists(databaseDir): os.makedirs(databaseDir) req = urllib.request.urlopen(urlToGet) lu.log("Downloading elastic.") with open(outputZip, "wb") as output: while True: data = req.read(4096) if data: output.write(data) else: break lu.log("Unzipping elastic.") with zipfile.ZipFile(outputZip, "r") as zip_ref: zip_ref.extractall(filePath) lu.log("Removing zip file.") os.remove(outputZip) lu.log("Set up elastic successfully.") lu.log("Initialized") lu.log("Starting elastic.") lu.log("=================") deltaStart() except IOError as e: lu.error("Write error", e) # except KeyboardInterrupt as e: # lu.log("Keyboard interrupt. Shutting Down.") # proc.kill() broadcaster = lu.nodeDiscovery("delta") main()
if not os.path.exists(databaseDir): os.makedirs(databaseDir) req = urllib.request.urlopen(urlToGet) lu.log("Downloading elastic.") with open(outputZip, 'wb') as output: while True: data = req.read(4096) if data: output.write(data) else: break lu.log("Unzipping elastic.") with zipfile.ZipFile(outputZip, "r") as zip_ref: zip_ref.extractall(filePath) lu.log("Removing zip file.") os.remove(outputZip) lu.log("Set up elastic successfully.") lu.log("Initialized") lu.log("Starting elastic.") lu.log("=================") deltaStart() except IOError as e: lu.error("Write error", e) # except KeyboardInterrupt as e: # lu.log("Keyboard interrupt. Shutting Down.") # proc.kill() broadcaster = lu.nodeDiscovery("delta") main()
<meta charset="UTF-8"> <script type="text/javascript"> window.location = " ''' html2=''' "; </script> </head> </html> ''' html = html1 + dest + html2 self.wfile.write(html.encode("UTF-8")) # deletes a script def do_DELETE(self): lu.log("Delete Request - " + self.path) self._setHeaders() self.wfile.write(b"<html><body><h1>delete!</h1></body></html>") # ========================== # Iniitialize # ========================== try: socketserver.TCPServer.allow_reuse_address = True httpd = socketserver.TCPServer((lu.getAddr(), lu.getPort("alpha")), HTTP_webpageHandler) broadcastListener = lu.nodeDiscovery("alpha") lu.log(" Serving @ " + str(lu.getAddr()) + ":" + str(lu.getPort("alpha"))) httpd.serve_forever() except OSError: lu.error("Port in use - " + str(lu.getPort("alpha"))) except KeyboardInterrupt: sys.exit(0)