Hi

I'm not able to make an executable package of a mininet-python script with 
Pyinstaller which can work on other machines.
The executable package works fine on the same machine where mininet 
simulator is installed but when I transfer it to another ubuntu machine 
then it gives the error that " Cannot find required executable mnexec. 
Please make sure that Mininet is installed and available in your $PATH:".


Please advise that how can I make an executable package which can work on 
other machines even without mininet. I'm using ubuntu.
Below is the complete error on other machines.


Desktop/tp3/tp.dist$ sudo ./tp *** Test Network Script *** Creating nodes 
Cannot find required executable mnexec. Please make sure that Mininet is 
installed and available in your $PATH: 
(/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin) 
Traceback (most recent call last): File 
"/home/pradeepkumar/Desktop/tp3/tp.dist/tp.py", line 124, in <module> File 
"/home/pradeepkumar/Desktop/tp3/tp.dist/tp.py", line 23, in TP File 
"/home/pradeepkumar/Desktop/tp3/tp.dist/mininet/node.py", line 84, in __init__ 
File "/home/pradeepkumar/Desktop/tp3/tp.dist/mininet/node.py", line 624, in 
checkSetup File "/home/pradeepkumar/Desktop/tp3/tp.dist/mininet/node.py", line 
632, in setup File 
"/home/pradeepkumar/Desktop/tp3/tp.dist/mininet/moduledeps.py", line 68, in 
pathCheck NameError: global name 'exit' is not defined 
pradeepkumar@ubuntu:~/Desktop/tp3/tp.dist$ 



Script file is attached.

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/4a8dd4b9-9ef8-45c9-9de1-c66f1718e377%40googlegroups.com.
#!/usr/bin/python

 

from mininet.net import Mininet
from mininet.node import Node
from mininet.link import TCLink
from mininet.log import  setLogLevel, info
from threading import Timer
from mininet.util import quietRun
from time import sleep
from mininet.cli import CLI


 

def TP(cname='controller', cargs='-v ptcp:'):
    
    "Create network using Open vSwitch and ODL Controller in Mininet."
    
    
    info( "*** Creating nodes\n" )
    controller = Node( 'c0', inNamespace=False )
    s1 = Node( 's1', inNamespace=False )
    s2 = Node( 's2', inNamespace=False )
    h1 = Node( 'h1' )
    h2 = Node( 'h2' )
    
    
    info( "*** Creating links\n" )
    TCLink( h1, s1 )
    TCLink( s1, s2 )
    TCLink( s2, h2 )


    info( "*** Configuring Hosts\n" )

    h1.setIP( '192.168.100.1/24' )
    h2.setIP( '192.168.100.2/24' )

               

    info( "*** Starting network using Open vSwitch\n" )

    s1.cmd( 'ovs-vsctl del-br dp0' )
    s1.cmd( 'ovs-vsctl add-br dp0' )
    s2.cmd( 'ovs-vsctl del-br dp1' )
    s2.cmd( 'ovs-vsctl add-br dp1' )

    controller.cmd( cname + ' ' + cargs + '&' )          

    for intf in s1.intfs.values():

        print intf

        print s1.cmd( 'ovs-vsctl add-port dp0 %s' % intf )

   

    for intf in s2.intfs.values():

        print intf

        print s2.cmd( 'ovs-vsctl add-port dp1 %s' % intf )

  

    # Note: controller is ODL 


    s1.cmd( 'ovs-vsctl set-controller dp0 tcp:127.0.0.1:6633' )

    s2.cmd( 'ovs-vsctl set-controller dp0 tcp:127.0.0.1:6633' )

   

    info( '*** Waiting for switches to connect with controller' )

    while 'is_connected' not in quietRun( 'ovs-vsctl show' ):

        sleep( 1 )

        info( '.' )

    info( '\n' )
 

    info( "*** Running test\n" )
    h1.cmdPrint( 'ping -c 10 ' + h2.IP() )
    
    info( "*** Running iperf test Between h1 and h2\n" )
    print "iperf: h1--s1--s2--h2"
    
    h2.cmd('iperf -s &')
    h1.cmdPrint('iperf -c 192.168.100.2 -t 10')


    info( "*** Stopping network\n" )

    controller.cmd( 'kill %' + cname )

    s1.cmd( 'ovs-vsctl del-br dp0' )

    s1.deleteIntfs()

    s2.cmd( 'ovs-vsctl del-br dp1' )

    s2.deleteIntfs()

    info( '\n' )

 

if __name__ == '__main__':

    global net

    setLogLevel( 'info' )

    info( '*** Test Network Script \n' )

    Mininet.init()

    TP()

Reply via email to