Exemplo n.º 1
0
 def getRemoteIP(self, nodeLocation):
     '''Ask the nodeLocation node for my IP.'''
     
     # Connect to the remote node
     (factory, conn) = Utils.getRemoteConnection(nodeLocation)
     try:
         nodeRef = yield factory.getRootObject()
     
         # Ask for the IP
         myIP = yield nodeRef.callRemote("getClientIP")
     except Exception, e:
         log.err()
         raise e
 def getBootstrapEnclaves(self,bootstrapNodeIP, bootstrapNodePort):
     '''Ask the passed in bootstrap node what it's enclave is.
        If it has multiple, this will fail since we don't know the right one then..
        in that case it must be specified.
     '''
     
     bsNodeLocation = NodeLocation(None, bootstrapNodeIP,bootstrapNodePort )
     # Get the remote reference
     (factory, conn) = Utils.getRemoteConnection(bsNodeLocation)
     bootstrapNodeRef = yield factory.getRootObject()
     
     enclaveNames = yield bootstrapNodeRef.callRemote("getEnclaveNames")
     
     # Close the connection to closerNodeLoc
     Utils.disconnect(None, conn)
     
     defer.returnValue(enclaveNames)