Esempio n. 1
0
 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
Esempio n. 2
0
 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
Esempio n. 3
0
 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
Esempio n. 5
0
    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
Esempio n. 6
0
 def getServerInfo(self):
     '''
     Return server host/port information
     '''
     return cobra.getLocalInfo()
Esempio n. 7
0
 def getServerInfo(self): 
     '''
     Return server host/port information
     '''
     return cobra.getLocalInfo() 
Esempio n. 8
0
 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