def store_file(self, filename):
        ''' Store a file into workbench '''
        
        # Spin up workbench
        self.workbench = zerorpc.Client(timeout=300, heartbeat=60)
        self.workbench.connect("tcp://127.0.0.1:4242")   

        # Open the file and send it to workbench
        storage_name = "streaming_pcap" + str(self.pcap_index)
        print filename, storage_name
        with open(filename,'rb') as f:
            self.workbench.store_sample(f.read(), storage_name, 'pcap')
        self.pcap_index += 1

        # Close workbench client
        self.workbench.close()
def store_file ( self , filename ) : self . workbench = zerorpc . Client ( timeout = 300 , heartbeat = 60 ) self . workbench . connect ( "tcp://127.0.0.1:4242" ) storage_name = "streaming_pcap" + str ( self . pcap_index ) print filename , storage_name with open ( filename , 'rb' ) as f : self . workbench . store_sample ( f . read ( ) , storage_name , 'pcap' ) self . pcap_index += 1 self . workbench . close ( )
Store a file into workbench