1. Matthew Turk
  2. yt.rife

Commits

Matthew Turk  committed bb91062

Adding HMAC keys.

  • Participants
  • Parent commits 61399a3
  • Branches default

Comments (0)

Files changed (2)

File client.py

View file
 from yt.mods import *
 import Pyro4
 
+hmac_key = raw_input("HMAC_KEY? ").strip()
 uri = raw_input("URI? ").strip()
+Pyro4.config.HMAC_KEY = hmac_key
 VRH = Pyro4.Proxy(uri)
 insert_ipython()

File main_engine.py

View file
 from mpi4py import MPI
 import time
 import Pyro4
+import uuid
+Pyro4.config.HMAC_KEY = uuid.uuid4().hex
 
 def requires_pf(func):
     @wraps(func)
         self.comm = comm
 
     def send(self, msg):
-        self.comm.mpi_bcast_pickled(msg)
+        self.comm.mpi_bcast(msg)
 
     def receive(self, msg):
         mylog.debug("Received message: %s, %s", msg['type'], msg['args'])
         
     def runwait(self):
         while self._run:
-            msg = self.comm.mpi_bcast_pickled(None)
+            msg = self.comm.mpi_bcast(None)
             if msg is not None: self.receive(msg)
 
 class VolumeRenderingHandler(LockstepProxy):
 
 if __name__ == "__main__":
     VRH = VolumeRenderingHandler()
+    print "HMAC KEY", Pyro4.config.HMAC_KEY
     if MPI.COMM_WORLD.rank == 0:
         Pyro4.Daemon.serveSimple(
             {VRH: "yt.volume_rendering_handler"},