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
log line when terminating
[nodemanager.git]
/
nodemanager.py
diff --git
a/nodemanager.py
b/nodemanager.py
index
e998a04
..
4b030d5
100755
(executable)
--- a/
nodemanager.py
+++ b/
nodemanager.py
@@
-74,7
+74,10
@@
class NodeManager:
# Deal with plugins directory
if os.path.exists(self.options.path):
sys.path.append(self.options.path)
# Deal with plugins directory
if os.path.exists(self.options.path):
sys.path.append(self.options.path)
- plugins = [ os.path.split(os.path.splitext(x)[0])[1] for x in glob.glob( os.path.join(self.options.path,'*.py') ) ]
+ plugins = [ os.path.split(os.path.splitext(x)[0])[1]
+ for x in glob.glob( os.path.join(self.options.path,'*.py') )
+ if not x.endswith("/__init__.py")
+ ]
self.modules += plugins
if self.options.user_module:
assert self.options.user_module in self.modules
self.modules += plugins
if self.options.user_module:
assert self.options.user_module in self.modules
@@
-171,12
+174,16
@@
class NodeManager:
return {}
def run(self):
return {}
def run(self):
+ # make sure to create /etc/planetlab/virt so others can read that
+ # used e.g. in vsys-scripts's sliceip
+ tools.get_node_virt()
try:
if self.options.daemon: tools.daemon()
# set log level
if (self.options.verbose):
logger.set_level(logger.LOG_VERBOSE)
try:
if self.options.daemon: tools.daemon()
# set log level
if (self.options.verbose):
logger.set_level(logger.LOG_VERBOSE)
+ tools.init_signals()
# Load /etc/planetlab/plc_config
config = Config(self.options.config)
# Load /etc/planetlab/plc_config
config = Config(self.options.config)
@@
-255,7
+262,10
@@
If this is not the case, please remove the pid file %s. -- exiting""" % (other_p
work_duration=int(work_end-work_beg)
logger.log('nodemanager: mainloop has worked for %s s - sleeping for %d s'%(work_duration,delay))
time.sleep(delay)
work_duration=int(work_end-work_beg)
logger.log('nodemanager: mainloop has worked for %s s - sleeping for %d s'%(work_duration,delay))
time.sleep(delay)
- except: logger.log_exc("nodemanager: failed in run")
+ except SystemExit:
+ pass
+ except:
+ logger.log_exc("nodemanager: failed in run")
def run():
logger.log("======================================== Entering nodemanager.py")
def run():
logger.log("======================================== Entering nodemanager.py")