(self)
Prepare the interface for capture. If the interface won't be used for capture,
        update its status accordingly to.
        :raises: RuntimeError
Prepare the interface for capture. If the interface won't be used for capture,
        update its status accordingly to.
        :raises: RuntimeError
Prepare the interface for capture . If the interface won t be used for capture update its status accordingly to . : raises : RuntimeError
def prepare(self):
        """Prepare the interface for capture. If the interface won't be used for capture,
        update its status accordingly to.
        :raises: RuntimeError"""

        # Make sure this interface is up.
        cmd = ['ip', 'link', 'set',
               self.name, 'up',
               'promisc', 'on',
               'mtu', str(settings.MTU)]
        with tempfile.TemporaryFile() as tmpfile:
            if sp.call(cmd, stdout=tmpfile, stderr=tmpfile) != 0:
                tmpfile.seek(0)
                raise RuntimeError("Could not configure interface {}. {}"
                                   .format(self.name, tmpfile.read()))

        #TODO: Properly enable the interface for PFRING ZC

        self.running_enabled = self.enabled
        if self.queues is not None:
            self.queues = self.target_queues
        self.save()
def prepare ( self ) : # Make sure this interface is up. cmd = [ 'ip' , 'link' , 'set' , self . name , 'up' , 'promisc' , 'on' , 'mtu' , str ( settings . MTU ) ] with tempfile . TemporaryFile ( ) as tmpfile : if sp . call ( cmd , stdout = tmpfile , stderr = tmpfile ) != 0 : tmpfile . seek ( 0 ) raise RuntimeError ( "Could not configure interface {}. {}" . format ( self . name , tmpfile . read ( ) ) ) #TODO: Properly enable the interface for PFRING ZC self . running_enabled = self . enabled if self . queues is not None : self . queues = self . target_queues self . save ( )