]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
change manhole setup for queen too
authorBrian Warner <warner@lothar.com>
Fri, 1 Dec 2006 02:38:38 +0000 (19:38 -0700)
committerBrian Warner <warner@lothar.com>
Fri, 1 Dec 2006 02:38:38 +0000 (19:38 -0700)
allmydata/queen.py

index 849425d59b6aefc438052afe5b864d27994f89b4..42d10333998dfa93881bfb230f9ea334c0a4d4ac 100644 (file)
@@ -43,7 +43,6 @@ class Roster(service.MultiService, Referenceable):
 class Queen(service.MultiService):
     CERTFILE = "queen.pem"
     PORTNUMFILE = "queen.port"
-    AUTHKEYSFILE = "authorized_keys"
 
     def __init__(self):
         service.MultiService.__init__(self)
@@ -63,11 +62,15 @@ class Queen(service.MultiService):
         # any services with the Tub until after that point
         self.tub.setServiceParent(self)
         self.urls = {}
-        if os.path.exists(self.AUTHKEYSFILE):
-            from allmydata import manhole
-            m = manhole.AuthorizedKeysManhole(8021, self.AUTHKEYSFILE)
-            m.setServiceParent(self)
-            log.msg("AuthorizedKeysManhole listening on 8021")
+
+        AUTHKEYSFILEBASE = "authorized_keys."
+        for f in os.listdir("."):
+            if f.startswith(AUTHKEYSFILEBASE):
+                portnum = int(f[len(AUTHKEYSFILEBASE):])
+                from allmydata import manhole
+                m = manhole.AuthorizedKeysManhole(portnum, f)
+                m.setServiceParent(self)
+                log.msg("AuthorizedKeysManhole listening on %d" % portnum)
 
     def _setup_tub(self, local_ip):
         l = self.tub.getListeners()[0]