[FIXES] Corrected a bug when disconnecting a link
author"Jeremy Grossmann"
Wed Feb 06 21:59:03 2008 +0100 (2008-02-06)
changeset 454a330c9bf4937
parent 453 2bcef00ce53b
child 455 887c841e1b74
[FIXES] Corrected a bug when disconnecting a link
src/GNS3/Topology.py
src/GNS3/Ui/ConfigurationPages/Page_IOSRouter.py
src/GNS3/Workspace.py
     1.1 --- a/src/GNS3/Topology.py	Wed Feb 06 19:56:30 2008 +0100
     1.2 +++ b/src/GNS3/Topology.py	Wed Feb 06 21:59:03 2008 +0100
     1.3 @@ -184,7 +184,7 @@
     1.4              src_node.set_hypervisor(dst_node.hypervisor)
     1.5          if not isinstance(dst_node, IOSRouter):
     1.6              dst_node.set_hypervisor(src_node.hypervisor)
     1.7 -        
     1.8 +
     1.9          src_node.hypervisor.configchange = True
    1.10          dst_node.hypervisor.configchange = True
    1.11          srcdev = self.__nodes[srcid].get_dynagen_device()
    1.12 @@ -219,19 +219,29 @@
    1.13          srcdev = link.source.get_dynagen_device()
    1.14          dstdev = link.dest.get_dynagen_device()
    1.15          try:
    1.16 -            if type(link.source) == IOSRouter:
    1.17 +            if isinstance(link.source, IOSRouter):
    1.18                  globals.GApp.dynagen.disconnect(srcdev, link.srcIf, dstdev.name + ' ' + link.destIf)
    1.19 -            elif type(link.dest) == IOSRouter:
    1.20 +                link.source.set_config(link.source.get_config())
    1.21 +            elif isinstance(link.dest, IOSRouter):
    1.22                  globals.GApp.dynagen.disconnect(dstdev, link.destIf, srcdev.name + ' ' + link.srcIf)
    1.23 +                link.dest.set_config(link.dest.get_config())
    1.24          except lib.DynamipsError, msg:
    1.25              QtGui.QMessageBox.critical(globals.GApp.mainWindow, translate("Topology", "Dynamips error"),  str(msg))
    1.26              return
    1.27 +            
    1.28 +
    1.29 +        if isinstance(link.source, IOSRouter):
    1.30 +            link.source.set_config(link.source.get_config())
    1.31 +        if isinstance(link.dest, IOSRouter):
    1.32 +            link.dest.set_config(link.dest.get_config())
    1.33 +            
    1.34          link.source.deleteEdge(link)
    1.35          link.dest.deleteEdge(link)
    1.36          if link in self.__links:
    1.37              self.__links.remove(link)
    1.38              self.removeItem(link)
    1.39          globals.GApp.dynagen.update_running_config()
    1.40 +        print globals.GApp.dynagen.running_config
    1.41  
    1.42      def __getLinks(self):
    1.43          """ Return topology links
     2.1 --- a/src/GNS3/Ui/ConfigurationPages/Page_IOSRouter.py	Wed Feb 06 19:56:30 2008 +0100
     2.2 +++ b/src/GNS3/Ui/ConfigurationPages/Page_IOSRouter.py	Wed Feb 06 21:59:03 2008 +0100
     2.3 @@ -87,6 +87,8 @@
     2.4          for (slot_number,  slot_modules) in lib.ADAPTER_MATRIX[platform][chassis].iteritems():
     2.5              if type(slot_modules) == str:
     2.6                  self.widget_slots[slot_number].addItem(slot_modules)
     2.7 +            elif platform == 'c7200' and slot_number == 0:
     2.8 +                self.widget_slots[slot_number].addItems(list(slot_modules))
     2.9              else:
    2.10                  self.widget_slots[slot_number].addItems([''] + list(slot_modules))
    2.11              if router_config['slots'][slot_number]:
     3.1 --- a/src/GNS3/Workspace.py	Wed Feb 06 19:56:30 2008 +0100
     3.2 +++ b/src/GNS3/Workspace.py	Wed Feb 06 21:59:03 2008 +0100
     3.3 @@ -339,7 +339,6 @@
     3.4              except (lib.DynamipsErrorHandled,  socket.error):
     3.5                  QtGui.QMessageBox.critical(self, node.hostname + ': ' + translate("Workspace", "Dynamips error"), translate("Workspace", "Connection lost"))
     3.6                  progress.reset()
     3.7 -                self.switchToMode_Design()
     3.8                  return
     3.9              current += 1
    3.10          progress.setValue(count)