Merge database from trunk. Runs ensure created on every account type.
[nodemanager.git] / net.py
diff --git a/net.py b/net.py
index 2e7f6eb..606527c 100644 (file)
--- a/net.py
+++ b/net.py
@@ -13,10 +13,17 @@ import sioc, plnet
 # local modules
 import bwlimit, logger, iptables
 
-def GetSlivers(plc, data):
-    InitInterfaces(plc, data)
-    InitNodeLimit(data)
-    InitI2(plc, data)
+def GetSlivers(plc, data, config):
+    InitInterfaces(plc, data) # writes sysconfig files.
+    if ('OVERRIDES' in dir(config)) and (config.OVERRIDESget('net_max_rate') == -1):
+        logger.log("Slice and node BW Limits disabled.")
+        if len(bwlimit.get()): 
+            logger.verbose("*** DISABLING NODE BW LIMITS ***")
+            bwlimit.stop()
+    else:
+        InitNodeLimit(data)
+        InitI2(plc, data)
+        
     InitNAT(plc, data)
 
 def InitNodeLimit(data):
@@ -29,8 +36,6 @@ def InitNodeLimit(data):
     for dev in devs:
         macs[sioc.gifhwaddr(dev).lower()] = dev
 
-    # XXX Exempt Internet2 destinations from node bwlimits
-    # bwlimit.exempt_init('Internet2', internet2_ips)
     for network in data['networks']:
         # Get interface name preferably from MAC address, falling
         # back on IP address.
@@ -141,7 +146,7 @@ def InitNAT(plc, data):
 
 def InitInterfaces(plc, data):
     if not 'networks' in data: return
-    pyplnet.InitInterfaces(logger, plc, data)
+    plnet.InitInterfaces(logger, plc, data)
 
 def start(options, config):
     pass