git://git.onelab.eu
/
nodemanager.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge from head.
[nodemanager.git]
/
bwmon.py
diff --git
a/bwmon.py
b/bwmon.py
index
07006f1
..
c2c9ffe
100644
(file)
--- a/
bwmon.py
+++ b/
bwmon.py
@@
-15,7
+15,7
@@
# Faiyaz Ahmed <faiyaza@cs.princeton.edu>
# Copyright (C) 2004-2006 The Trustees of Princeton University
#
# Faiyaz Ahmed <faiyaza@cs.princeton.edu>
# Copyright (C) 2004-2006 The Trustees of Princeton University
#
-# $Id$
+# $Id
: bwmon.py,v 1.1.2.8 2007/04/25 22:20:58 faiyaza Exp
$
#
import os
#
import os
@@
-45,7
+45,7
@@
bits_per_byte = 8
# Defaults
debug = False
# Defaults
debug = False
-verbose =
True
+verbose =
False
datafile = "/var/lib/misc/bwmon.dat"
#nm = None
datafile = "/var/lib/misc/bwmon.dat"
#nm = None
@@
-417,11
+417,11
@@
def GetSlivers(db):
(version, slices) = pickle.load(f)
f.close()
# Check version of data file
(version, slices) = pickle.load(f)
f.close()
# Check version of data file
- if version != "$Id$":
+ if version != "$Id
: bwmon.py,v 1.1.2.8 2007/04/25 22:20:58 faiyaza Exp
$":
logger.log("bwmon: Not using old version '%s' data file %s" % (version, datafile))
raise Exception
except Exception:
logger.log("bwmon: Not using old version '%s' data file %s" % (version, datafile))
raise Exception
except Exception:
- version = "$Id$"
+ version = "$Id
: bwmon.py,v 1.1.2.8 2007/04/25 22:20:58 faiyaza Exp
$"
slices = {}
# Get/set special slice IDs
slices = {}
# Get/set special slice IDs
@@
-519,13
+519,8
@@
def GetSlivers(db):
else:
# Just in case. Probably (hopefully) this will never happen.
# New slice, initialize state
else:
# Just in case. Probably (hopefully) this will never happen.
# New slice, initialize state
- logger.log("bwmon: New Slice %s" % name)
- slice = slices[xid] = Slice(xid, name, db[slice.name]['_rspec'])
- slice.reset(maxrate, \
- maxexemptrate, \
- usedbytes, \
- usedi2bytes, \
- db[slice.name]['_rspec'])
+ logger.log("bwmon: Deleting orphaned slice xid %s" % xid)
+ bwlimit.off(xid)
# Delete dead slices
dead = Set(slices.keys()) - Set(live.keys())
# Delete dead slices
dead = Set(slices.keys()) - Set(live.keys())