Skip to content
Snippets Groups Projects
Commit a3879524 authored by Brian O'Connor's avatar Brian O'Connor
Browse files

fixed host ip assignment and shutdown with xterms

fixes #189
parent 7523c420
No related branches found
No related tags found
No related merge requests found
...@@ -563,7 +563,9 @@ def build( self ): ...@@ -563,7 +563,9 @@ def build( self ):
if 'Switch' in tags: if 'Switch' in tags:
net.addSwitch( name ) net.addSwitch( name )
elif 'Host' in tags: elif 'Host' in tags:
net.addHost( name, ip=ipStr( nodeNum ) ) #Generate IP adddress in the 10.0/8 block
ipAddr = ( 10 << 24 ) + nodeNum
net.addHost( name, ip=ipStr( ipAddr ) )
else: else:
raise Exception( "Cannot create mystery node: " + name ) raise Exception( "Cannot create mystery node: " + name )
# Make links # Make links
...@@ -601,8 +603,7 @@ def xterm( self, _ignore=None ): ...@@ -601,8 +603,7 @@ def xterm( self, _ignore=None ):
if name not in self.net.nameToNode: if name not in self.net.nameToNode:
return return
term = makeTerm( self.net.nameToNode[ name ], 'Host' ) term = makeTerm( self.net.nameToNode[ name ], 'Host' )
self.net.terms.append( term ) self.net.terms += term
def miniEditImages(): def miniEditImages():
"Create and return images for MiniEdit." "Create and return images for MiniEdit."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment