Split api_calls.py and api.py to make the documentation of the XMLRPC calls
[nodemanager.git] / bwmon.py
index 9d0fbaf..977aa0b 100644 (file)
--- a/bwmon.py
+++ b/bwmon.py
@@ -404,8 +404,6 @@ def gethtbs(root_xid, default_xid):
         
         name = bwlimit.get_slice(xid)
 
-        
-        
         if (name is None) \
         and (xid != root_xid) \
         and (xid != default_xid):
@@ -503,7 +501,14 @@ def sync(nmdbcopy):
     # Incase we rebooted and need to keep track of already running htbs 
     norecxids =  Set(livehtbs.keys()) - Set(slices.keys())
     logger.log("bwmon:  Found %s slices that have htbs but not in dat." % norecxids.__len__())
-    newslicesxids.update(norecxids)
+       # Reset tc counts.
+    for norecxid in norecxids:
+        slices[norecxid] = Slice(norecxid, live[norecxid]['name'], live[norecxid]['_rspec'])
+        slices[norecxid].reset(livehtbs[norecxid]['maxrate'], 
+                            livehtbs[norecxid]['maxexemptrate'], 
+                            livehtbs[norecxid]['usedbytes'], 
+                            livehtbs[norecxid]['usedi2bytes'], 
+                            live[norecxid]['_rspec'])
         
     # Setup new slices
     for newslice in newslicesxids: