log subprocess calls.
[nodemanager.git] / net.py
diff --git a/net.py b/net.py
index d2cc7ed..4bd7c71 100644 (file)
--- a/net.py
+++ b/net.py
@@ -14,18 +14,23 @@ import sioc, plnet
 import bwlimit, logger, iptables
 
 def GetSlivers(plc, data, config):
-    InitInterfaces(plc, data)
-    if 'OVERRIDES' in dir(config):
-        if config.OVERRIDES.get('net_max_rate') != -1:
-            InitNodeLimit(data)
-            InitI2(plc, data)
-        else:
-            logger.log("Slice and node BW Limits disabled.")
-            if len(bwlimit.get()): 
+    logger.verbose("net:GetSlivers called.")
+    InitInterfaces(plc, data) # writes sysconfig files.
+    if 'OVERRIDES' in dir(config): 
+        if config.OVERRIDES.get('net_max_rate') == '-1':
+            logger.log("net: Slice and node BW Limits disabled.")
+            if len(bwlimit.tc("class show dev eth0")): 
                 logger.verbose("*** DISABLING NODE BW LIMITS ***")
                 bwlimit.stop()
+        else:
+            InitNodeLimit(data)
+            InitI2(plc, data)
+    else:
+        InitNodeLimit(data)
+        InitI2(plc, data)
     InitNAT(plc, data)
 
+
 def InitNodeLimit(data):
     if not 'networks' in data: return