Revision 98332cb6 mininet.py

View differences:

mininet.py
136 136
   def terminate( self ):
137 137
      self.cleanup()
138 138
      os.kill( self.pid, signal.SIGKILL )
139
   def stop( self ): self.terminate()
139 140
   def waitReadable( self ): self.pollOut.poll()
140 141
   def sendCmd( self, cmd ):
141 142
      """Send a command, followed by a command to echo a sentinel,
......
198 199
      return intfName
199 200
   def setIP( self, intf, ip, bits ):
200 201
      "Set an interface's IP address."
201
      result = self.cmd( [ 'ifconfig', intf, ip + bits, 'up' ] )
202
      result = self.cmdPrint( [ 'ifconfig', intf, ip + bits, 'up' ] )
202 203
      self.ips[ intf ] = ip
203 204
      return result
204 205
   def setHostRoute( self, ip, intf ):
......
246 247
   def start( self, controller='controller', args='ptcp:' ):
247 248
      "Start <controller> <args> on controller, logging to /tmp/cN.log"
248 249
      cout = '/tmp/' + self.name + '.log'
249
      self.cmdPrint( controller + ' ' + args + 
250
      self.cmdPrint( 'exec ' + controller + ' ' + args + 
250 251
         ' 1> ' + cout + ' 2> ' + cout + ' &' )
252
      self.execed = True
251 253
   def stop( self, controller='controller' ):
252 254
      "Stop controller cprog on controller"
253
      self.cmd( "kill %" + controller )  
255
      self.terminate()
256
      # self.cmd( "kill %" + controller )  
254 257
         
255 258
class Switch( Node ):
256 259
   """A Switch is a Node that is running (or has execed)

Also available in: Unified diff