def getTrace(self): trace = vtrace.getTrace() host, port = cobra.getLocalInfo() unique = vtrace.cobra_daemon.shareObject(trace) trace.proxy = cobra.CobraProxy("cobra://%s:%d/%s" % (host, port, unique)) return unique
def getTrace(self): trace = vtrace.getTrace() host,port = cobra.getLocalInfo() unique = md5.md5(os.urandom(20)).hexdigest() vtrace.cobra_daemon.shareObject(trace, unique) trace.proxy = cobra.CobraProxy("cobra://%s:%d/%s" % (host,port,unique)) return unique
def getTrace(self): trace = vtrace.getTrace() host, port = cobra.getLocalInfo() unique = md5(os.urandom(20)).hexdigest() vtrace.cobra_daemon.shareObject(trace, unique) trace.proxy = cobra.CobraProxy("cobra://%s:%d/%s" % (host, port, unique)) return unique
def openSharedFile(self, filename): ''' Return a URI for an open file decriptor for the specified filename. NOTE: use openSharedFile() method on work unit to get back a proxy. ''' if not self.sharedfiles.get(filename): raise Exception('File %s is not shared!') fd = file(filename, 'rb') cname = self.cobrad.shareObject(fd, doref=True) host, port = cobra.getLocalInfo() uri = 'cobra://%s:%d/%s' % (host, port, cname) return uri
def openSharedFile(self, filename): ''' Return a URI for an open file decriptor for the specified filename. NOTE: use openSharedFile() method on work unit to get back a proxy. ''' if not self.sharedfiles.get(filename): raise Exception('File %s is not shared!') fd = file(filename, 'rb') cname = self.cobrad.shareObject(fd, doref=True) host,port = cobra.getLocalInfo() uri = 'cobra://%s:%d/%s' % (host, port, cname) return uri
def getServerInfo(self): ''' Return server host/port information ''' return cobra.getLocalInfo()
def getTrace(self): trace = vtrace.getTrace() host,port = cobra.getLocalInfo() unique = vtrace.cobra_daemon.shareObject(trace) trace.proxy = cobra.CobraProxy("cobra://%s:%d/%s" % (host,port,unique)) return unique