Example #1
0
    def __init__(self, swap_settings=None):
        """
        Class constructor
        
        @param swap_settings: path to the main SWAP configuration file
        @param verbose: Print out SWAP frames or not
        @param monitor: Print out network events or not
        """

        # Main configuration file
        self.swap_settings = swap_settings
        # Print SWAP activity
        self._print_swap = False

        try:
            self.main_settings = XmlSettings(self.swap_settings)
            # Set log file to trace lagarto exceptions
            LagartoException.error_file = XmlSettings.error_file
            # Superclass call
            SwapInterface.__init__(self, swap_settings)
        except:
            raise

        # Lagarto process constructor
        LagartoProcess.__init__(self, working_dir)

        if XmlSettings.debug == 2:
            self._print_swap = True

        self.lagarto_config = XmlLagarto(
            os.path.join(config_dir, "lagarto.xml"))
Example #2
0
    def __init__(self, swap_settings=None):
        """
        Class constructor
        
        @param swap_settings: path to the main SWAP configuration file
        @param verbose: Print out SWAP frames or not
        @param monitor: Print out network events or not
        """
       
        # Main configuration file
        self.swap_settings = swap_settings
        # Print SWAP activity
        self._print_swap = False
        
        try:
            self.main_settings = XmlSettings(self.swap_settings)
            # Set log file to trace lagarto exceptions
            LagartoException.error_file = XmlSettings.error_file
            # Superclass call
            SwapInterface.__init__(self, swap_settings)
        except:
            raise

        # Lagarto process constructor
        LagartoProcess.__init__(self, working_dir)

        if XmlSettings.debug == 2:
            self._print_swap = True
            
        self.lagarto_config = XmlLagarto(os.path.join(config_dir, "lagarto.xml"))
Example #3
0
 def stop(self):
     """
     Stop SWAP manager
     """
     # Stop SWAP server
     self.server.stop()
     # Stop Lagarto server
     LagartoProcess.stop(self)
Example #4
0
 def stop(self):
     """
     Stop SWAP manager
     """
     # Stop SWAP server
     self.server.stop()
     # Stop Lagarto server
     LagartoProcess.stop(self)