git://git.onelab.eu
/
nodemanager.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5a07536
)
Move call to update i2 ip address into GetSlivers. Move try catch out of main into...
author
Faiyaz Ahmed
<faiyaza@cs.princeton.edu>
Tue, 4 Sep 2007 20:52:53 +0000
(20:52 +0000)
committer
Faiyaz Ahmed
<faiyaza@cs.princeton.edu>
Tue, 4 Sep 2007 20:52:53 +0000
(20:52 +0000)
nm.py
patch
|
blob
|
history
diff --git
a/nm.py
b/nm.py
index
f951765
..
a7f1f70
100644
(file)
--- a/
nm.py
+++ b/
nm.py
@@
-1,5
+1,7
@@
#!/usr/bin/python
#!/usr/bin/python
+# $Id: $
+
"""Node Manager"""
import optparse
"""Node Manager"""
import optparse
@@
-32,9
+34,15
@@
modules = []
def GetSlivers(plc):
data = plc.GetSlivers()
def GetSlivers(plc):
data = plc.GetSlivers()
+ # Set i2 ip list for nodes in I2 nodegroup.
+ try: net.GetSlivers(plc, data)
+ except: logger.log_exc()
+ # All other callback modules
for module in modules:
for module in modules:
- callback = getattr(module, 'GetSlivers')
- callback(data)
+ try:
+ callback = getattr(module, 'GetSlivers')
+ callback(data)
+ except: logger.log_exc()
def run():
try:
def run():
try:
@@
-70,12
+78,8
@@
def run():
plc = PLCAPI(config.plc_api_uri, config.cacert, session, timeout=options.period/2)
while True:
plc = PLCAPI(config.plc_api_uri, config.cacert, session, timeout=options.period/2)
while True:
- # Set i2 ip list for nodes in I2 nodegroup.
- try: net.GetSlivers(plc, data)
- except: logger.log_exc()
- # Main NM Loop
- try: GetSlivers(plc)
- except: logger.log_exc()
+ # Main NM Loop
+ GetSlivers(plc)
time.sleep(options.period + random.randrange(0,301))
except: logger.log_exc()
time.sleep(options.period + random.randrange(0,301))
except: logger.log_exc()