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
expects the 'interfaces' key in GetSlivers - review logs to always mention module
[nodemanager.git]
/
sm.py
diff --git
a/sm.py
b/sm.py
index
627a649
..
6192ba1
100644
(file)
--- a/
sm.py
+++ b/
sm.py
@@
-63,16
+63,16
@@
def GetSlivers(data, config = None, plc=None, fullupdate=True):
in, use the GetSlivers() heartbeat as a cue to scan for expired
slivers."""
in, use the GetSlivers() heartbeat as a cue to scan for expired
slivers."""
- logger.verbose("
Entering sm:
GetSlivers with fullupdate=%r"%fullupdate)
+ logger.verbose("
sm: Entering
GetSlivers with fullupdate=%r"%fullupdate)
for key in data.keys():
for key in data.keys():
- logger.verbose('GetSlivers key : ' + key)
+ logger.verbose('
sm:
GetSlivers key : ' + key)
node_id = None
try:
f = open('/etc/planetlab/node_id')
try: node_id = int(f.read())
finally: f.close()
node_id = None
try:
f = open('/etc/planetlab/node_id')
try: node_id = int(f.read())
finally: f.close()
- except: logger.log_exc()
+ except: logger.log_exc(
"sm: GetSlivers failed to read /etc/planetlab/node_id"
)
if data.has_key('node_id') and data['node_id'] != node_id: return
if data.has_key('node_id') and data['node_id'] != node_id: return
@@
-82,13
+82,16
@@
def GetSlivers(data, config = None, plc=None, fullupdate=True):
DEFAULT_ALLOCATION['net_max_rate'] = network['bwlimit'] / 1000
# Take intscripts (global) returned by API, make dict
DEFAULT_ALLOCATION['net_max_rate'] = network['bwlimit'] / 1000
# Take intscripts (global) returned by API, make dict
+ if 'initscripts' not in data:
+ logger.log_missing_data("sm.GetSlivers",'initscripts')
+ return
initscripts = {}
for is_rec in data['initscripts']:
initscripts = {}
for is_rec in data['initscripts']:
- logger.verbose("initscript: %s" % is_rec['name'])
+ logger.verbose("
sm:
initscript: %s" % is_rec['name'])
initscripts[str(is_rec['name'])] = is_rec['script']
for sliver in data['slivers']:
initscripts[str(is_rec['name'])] = is_rec['script']
for sliver in data['slivers']:
- logger.verbose("sm:
GetSlivers in slivers loop"
)
+ logger.verbose("sm:
%s: sm:GetSlivers in slivers loop"%sliver['name']
)
rec = sliver.copy()
rec.setdefault('timestamp', data['timestamp'])
rec = sliver.copy()
rec.setdefault('timestamp', data['timestamp'])