From d3cd22f9c16e3fc5268e5931e3e7c585b19f0f8b Mon Sep 17 00:00:00 2001 From: Faiyaz Ahmed Date: Tue, 26 Jun 2007 18:00:46 +0000 Subject: [PATCH] Start tracking HTBS that are already running (presumeably after a software upgrade). --- bwmon.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/bwmon.py b/bwmon.py index 4fb581d..9d0fbaf 100644 --- a/bwmon.py +++ b/bwmon.py @@ -15,7 +15,7 @@ # Faiyaz Ahmed # Copyright (C) 2004-2006 The Trustees of Princeton University # -# $Id: bwmon.py,v 1.20 2007/06/15 20:29:26 faiyaza Exp $ +# $Id: bwmon.py,v 1.21 2007/06/16 14:30:17 faiyaza Exp $ # import os @@ -458,11 +458,11 @@ def sync(nmdbcopy): (version, slices) = pickle.load(f) f.close() # Check version of data file - if version != "$Id: bwmon.py,v 1.20 2007/06/15 20:29:26 faiyaza Exp $": + if version != "$Id: bwmon.py,v 1.21 2007/06/16 14:30:17 faiyaza Exp $": logger.log("bwmon: Not using old version '%s' data file %s" % (version, datafile)) raise Exception except Exception: - version = "$Id: bwmon.py,v 1.20 2007/06/15 20:29:26 faiyaza Exp $" + version = "$Id: bwmon.py,v 1.21 2007/06/16 14:30:17 faiyaza Exp $" slices = {} # Get/set special slice IDs @@ -500,11 +500,10 @@ def sync(nmdbcopy): newslicesxids = Set(live.keys()) - Set(livehtbs.keys()) logger.log("bwmon: Found %s new slices" % newslicesxids.__len__()) - # Incase we rebooted and need to bring up the htbs that are in the db but - # not known to tc. - #nohtbxids = Set(slices.keys()) - Set(livehtbs.keys()) - #logger.log("bwmon: Found %s slices that should have htbs but dont." % nohtbxids.__len__()) - #newslicesxids.update(nohtbxids) + # 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) # Setup new slices for newslice in newslicesxids: -- 2.47.0