Exemple #1
0
 def start_nm(name, config):
   logstream.write("INFO: Running: "+name+"\n")
   # Override the configuration
   injectconfig.inject(NET_KEY, config, "nodeman.cfg")
   # Start the NM
   p =  subprocess.Popen("python nmmain.py", shell=True)
   # Wait a bit for everything to settle
   time.sleep(3)
Exemple #2
0
 def start_nm(name, config):
     logstream.write("INFO: Running: " + name + "\n")
     # Override the configuration
     injectconfig.inject(NET_KEY, config, "nodeman.cfg")
     # Start the NM
     p = subprocess.Popen("python nmmain.py", shell=True)
     # Wait a bit for everything to settle
     time.sleep(3)
Exemple #3
0
 
 # We need getmyip()
 import misc
 DEFAULT_IP = misc.getmyip()
 LOOPBACK_IP = "127.0.0.1"
 JUNK_IP = "128.0.0.255"
 
 # Get the os hooks so that we can see if a network socket is in use
 os_api = nonportable.os_api
 
 # We need this to change the nm configuration file
 import injectconfig
 
 allowed_port = 50000
 # First override the ports, only use one port, so we know what to check
 injectconfig.inject('ports', [allowed_port], "nodeman.cfg")
 
 # The NM will use a constant key, store this
 NET_KEY = 'networkrestrictions'
 
 # Create generic config dictionary
 config = {}
 config['nm_restricted'] = False
 config['nm_user_preference'] = []
 config['repy_restricted'] = False
 config['repy_nootherips'] = False
 config['repy_user_preference'] = []
 
 # Starts the NM after injecting the config for NET_KEY
 def start_nm(name, config):
   logstream.write("INFO: Running: "+name+"\n")
Exemple #4
0
    # We need getmyip()
    import misc
    DEFAULT_IP = misc.getmyip()
    LOOPBACK_IP = "127.0.0.1"
    JUNK_IP = "128.0.0.255"

    # Get the os hooks so that we can see if a network socket is in use
    os_api = nonportable.os_api

    # We need this to change the nm configuration file
    import injectconfig

    allowed_port = 50000
    # First override the ports, only use one port, so we know what to check
    injectconfig.inject('ports', [allowed_port], "nodeman.cfg")

    # The NM will use a constant key, store this
    NET_KEY = 'networkrestrictions'

    # Create generic config dictionary
    config = {}
    config['nm_restricted'] = False
    config['nm_user_preference'] = []
    config['repy_restricted'] = False
    config['repy_nootherips'] = False
    config['repy_user_preference'] = []

    # Starts the NM after injecting the config for NET_KEY
    def start_nm(name, config):
        logstream.write("INFO: Running: " + name + "\n")