f0c726a42f
This helps with virtualenv although it can open up another security hole if you end up using an unexpected python interpreter. Overall it seems to make sense to err on the side of usability but it's good to be aware of security. However, for the remaining utility scripts that require python 2, we explicitly note this with #!/usr/bin/python2.
26 lines
765 B
Python
Executable File
26 lines
765 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
"clusterdemo.py: demo of Mininet Cluster Edition prototype"
|
|
|
|
from mininet.examples.cluster import ( MininetCluster, SwitchBinPlacer,
|
|
RemoteLink )
|
|
# ^ Could also use: RemoteSSHLink, RemoteGRELink
|
|
from mininet.topolib import TreeTopo
|
|
from mininet.log import setLogLevel
|
|
from mininet.examples.clustercli import ClusterCLI as CLI
|
|
|
|
def demo():
|
|
"Simple Demo of Cluster Mode"
|
|
servers = [ 'localhost', 'ubuntu2', 'ubuntu3' ]
|
|
topo = TreeTopo( depth=3, fanout=3 )
|
|
net = MininetCluster( topo=topo, servers=servers, link=RemoteLink,
|
|
placement=SwitchBinPlacer )
|
|
net.start()
|
|
CLI( net )
|
|
net.stop()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
setLogLevel( 'info' )
|
|
demo()
|