Tweaks to separate command and options.

This commit is contained in:
Bob Lantz
2010-03-05 17:19:02 -08:00
parent 91b9e374a0
commit a16fae676f
+2 -2
View File
@@ -47,13 +47,13 @@ def connectToRootNS( network, switch, ip, prefixLen, routes ):
for net in routes:
root.cmd( 'route add -net ' + net + ' dev ' + intf )
def sshd( network, cmd='/usr/sbin/sshd -D' ):
def sshd( network, cmd='/usr/sbin/sshd', opts='-D' ):
"Start a network, connect it to root ns, and run sshd on all hosts."
switch = network.switches[ 0 ] # switch to use
ip = '10.123.123.1' # our IP address on host network
routes = [ '10.0.0.0/8' ] # host networks to route to
connectToRootNS( network, switch, ip, 8, routes )
for host in network.hosts: host.cmd( cmd + ' &' )
for host in network.hosts: host.cmd( cmd + ' ' + opts + '&' )
print
print "*** Hosts are running sshd at the following addresses:"
print