Commits

Britton Smith committed e85c61e

Pyro server script now writes HMAC key to a file that
only the user has permissions to.

  • Participants
  • Parent commits 3bad7bd

Comments (0)

Files changed (1)

File scripts/pyro_queue.py

+import os
 import Pyro4
 import uuid
 
 if my_rank == 0:
     my_q = PyroQueueRoot(comm)
     Pyro4.config.HMAC_KEY = uuid.uuid4().hex
-    print "HMAC KEY", Pyro4.config.HMAC_KEY
+    key_file = 'reason.key'
+    fd = os.open(key_file, os.O_CREAT, 0600)
+    os.close(fd)
+    out_file = file(key_file, 'w')
+    out_file.write("HMAC KEY: %s\n" % Pyro4.config.HMAC_KEY)
+    out_file.close()
+    mylog.info('See %s for HMAC key.', key_file)
     Pyro4.Daemon.serveSimple(
         {my_q: "yt.executor"},
-        ns=False)
+        ns=False, verbose=True)
 else:
     my_q = PyroQueueNonRoot(comm)
     my_q.run()