[FIXES] Correct bugs in ADAPTER_MATRIX for platform which have no
author"Jeremy Grossmann"
Wed Feb 06 19:56:30 2008 +0100 (2008-02-06)
changeset 4532bcef00ce53b
parent 452 48209fa3f233
child 454 a330c9bf4937
[FIXES] Correct bugs in ADAPTER_MATRIX for platform which have no
chassis
src/GNS3/Globals/Symbols.py
src/GNS3/Node/IOSRouter.py
src/GNS3/Node/IOSRouter3700.py
src/GNS3/Node/IOSRouter7200.py
src/GNS3/Ui/ConfigurationPages/Page_IOSRouter.py
src/GNS3/Ui/Widget_nodesDock.py
src/GNS3/Workspace.py
     1.1 --- a/src/GNS3/Globals/Symbols.py	Wed Feb 06 19:01:04 2008 +0100
     1.2 +++ b/src/GNS3/Globals/Symbols.py	Wed Feb 06 19:56:30 2008 +0100
     1.3 @@ -126,10 +126,3 @@
     1.4  #    'normal_svg_file': ":/symbols/PIX_firewall.normal.svg",
     1.5  #    'select_svg_file': ":/symbols/PIX_firewall.selected.svg"},
     1.6  )
     1.7 -
     1.8 -DECORATIVE_SYMBOLS = ("Multilayer switch", 
     1.9 -                      "Route switch processor",  
    1.10 -                      "Access Point", 
    1.11 -                      "Lightweight Access Point", 
    1.12 -                      "WLAN controller", 
    1.13 -                      "PIX firewall")
     2.1 --- a/src/GNS3/Node/IOSRouter.py	Wed Feb 06 19:01:04 2008 +0100
     2.2 +++ b/src/GNS3/Node/IOSRouter.py	Wed Feb 06 19:56:30 2008 +0100
     2.3 @@ -115,7 +115,7 @@
     2.4              'image',
     2.5              'cnfg',
     2.6              'mac',
     2.7 -            'iomem', 
     2.8 +            #'iomem', 
     2.9              'npe', 
    2.10              'midplane'
    2.11              ]
    2.12 @@ -253,7 +253,7 @@
    2.13          for module in self.router.slot:
    2.14              if module == None:
    2.15                  # get all possible modules for the specified router model and module slot
    2.16 -                possible_modules = lib.ADAPTER_MATRIX[self.router.model][self.router.model_string][slot_number]
    2.17 +                possible_modules = lib.ADAPTER_MATRIX[self.get_platform()][self.get_chassis()][slot_number]
    2.18                  for module_name in possible_modules:
    2.19                      # check if we want to use this module
    2.20                      if not MODULES_INTERFACES.has_key(module_name):
     3.1 --- a/src/GNS3/Node/IOSRouter3700.py	Wed Feb 06 19:01:04 2008 +0100
     3.2 +++ b/src/GNS3/Node/IOSRouter3700.py	Wed Feb 06 19:56:30 2008 +0100
     3.3 @@ -31,3 +31,10 @@
     3.4          IOSRouter.__init__(self, renderer_normal, renderer_select)
     3.5          IOSRouter3700Defaults.__init__(self)
     3.6          self.platform = 'c3700'
     3.7 +
     3.8 +    def get_chassis(self):
     3.9 +        """ Returns router model
    3.10 +        """
    3.11 +    
    3.12 +        assert(self.router)
    3.13 +        return ('')
     4.1 --- a/src/GNS3/Node/IOSRouter7200.py	Wed Feb 06 19:01:04 2008 +0100
     4.2 +++ b/src/GNS3/Node/IOSRouter7200.py	Wed Feb 06 19:56:30 2008 +0100
     4.3 @@ -31,3 +31,10 @@
     4.4          IOSRouter.__init__(self, renderer_normal, renderer_select)
     4.5          IOSRouter7200Defaults.__init__(self)
     4.6          self.platform = 'c7200'
     4.7 +
     4.8 +    def get_chassis(self):
     4.9 +        """ Returns router model
    4.10 +        """
    4.11 +    
    4.12 +        assert(self.router)
    4.13 +        return ('')
     5.1 --- a/src/GNS3/Ui/ConfigurationPages/Page_IOSRouter.py	Wed Feb 06 19:01:04 2008 +0100
     5.2 +++ b/src/GNS3/Ui/ConfigurationPages/Page_IOSRouter.py	Wed Feb 06 19:56:30 2008 +0100
     5.3 @@ -128,7 +128,7 @@
     5.4          if platform == 'c3600' and router_config['iomem']: 
     5.5              self.spinBoxIomem.setValue(router_config['iomem'])
     5.6          if router_config['midplane']:
     5.7 -            index = self.comboBoxMidplane.findText(router_config.midplane['midplane'])
     5.8 +            index = self.comboBoxMidplane.findText(router_config['midplane'])
     5.9              if index != -1:
    5.10                  self.comboBoxMidplane.setCurrentIndex(index)
    5.11          if router_config['npe']:
     6.1 --- a/src/GNS3/Ui/Widget_nodesDock.py	Wed Feb 06 19:01:04 2008 +0100
     6.2 +++ b/src/GNS3/Ui/Widget_nodesDock.py	Wed Feb 06 19:56:30 2008 +0100
     6.3 @@ -22,7 +22,7 @@
     6.4  from PyQt4 import QtCore, QtGui
     6.5  import GNS3.Ui.svg_resources_rc
     6.6  from GNS3.Utils import translate
     6.7 -from GNS3.Globals.Symbols import SYMBOLS,  DECORATIVE_SYMBOLS
     6.8 +from GNS3.Globals.Symbols import SYMBOLS
     6.9  
    6.10  class nodesDock(QtGui.QTreeWidget):
    6.11      """ Class for managing the node types list
     7.1 --- a/src/GNS3/Workspace.py	Wed Feb 06 19:01:04 2008 +0100
     7.2 +++ b/src/GNS3/Workspace.py	Wed Feb 06 19:56:30 2008 +0100
     7.3 @@ -298,30 +298,9 @@
     7.4          """
     7.5      
     7.6          for node in globals.GApp.topology.nodes.itervalues():
     7.7 -            if isinstance(node, IOSRouter) and node.dev.state == 'running':
     7.8 +            if isinstance(node, IOSRouter) and node.get_dynagen_device().state == 'running':
     7.9                  node.console()
    7.10  
    7.11 -    def __startNonIOSNodes(self):
    7.12 -        """ Start non IOS nodes (ETHSW, ATMSW, FRSW, Bridge, Cloud)
    7.13 -        """
    7.14 -    
    7.15 -        node_list = []
    7.16 -        for node in globals.GApp.topology.nodes.values():
    7.17 -            if type(node) != IOSRouter:
    7.18 -                node_list.append(node)
    7.19 -        for node in node_list:
    7.20 -            try:
    7.21 -                node.startNode()
    7.22 -            except lib.DynamipsError, msg:
    7.23 -                QtGui.QMessageBox.critical(self, node.hostname + ': ' + translate("Workspace", "Dynamips error"),  str(msg))
    7.24 -            except lib.DynamipsWarning,  msg:
    7.25 -                QtGui.QMessageBox.warning(self,  node.hostname + ': ' + translate("Workspace", "Dynamips warning"),  str(msg))
    7.26 -                continue
    7.27 -            except (lib.DynamipsErrorHandled,  socket.error):
    7.28 -                QtGui.QMessageBox.critical(self, node.hostname + ': ' + translate("Workspace", "Dynamips error"), translate("Workspace", "Connection lost"))
    7.29 -                self.switchToMode_Design()
    7.30 -                return
    7.31 -    
    7.32      def __launchProgressDialog(self,  action,  text):
    7.33          """ Launch a progress dialog and do a action
    7.34              action: string