parameters: (self)
docstring: Prepare the interface for capture. If the interface won't be used for capture,
          update its status accordingly to.
          :raises: RuntimeError
docstring_summary: Prepare the interface for capture. If the interface won't be used for capture,
          update its status accordingly to.
          :raises: RuntimeError
docstring_tokens: Prepare the interface for capture . If the interface won t be used for capture update its status accordingly to . : raises : RuntimeError
function: 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()
function_tokens: 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 ( )