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:
11c8567
)
Call /etc/init.d/codemux only when codemux is installed
author
Marc Fiuczynski
<mef@cs.princeton.edu>
Tue, 23 Feb 2010 05:25:14 +0000
(
05:25
+0000)
committer
Marc Fiuczynski
<mef@cs.princeton.edu>
Tue, 23 Feb 2010 05:25:14 +0000
(
05:25
+0000)
plugins/codemux.py
patch
|
blob
|
history
diff --git
a/plugins/codemux.py
b/plugins/codemux.py
index
25b866f
..
f14fdc0
100644
(file)
--- a/
plugins/codemux.py
+++ b/
plugins/codemux.py
@@
-12,7
+12,7
@@
from config import Config
CODEMUXCONF="/etc/codemux/codemux.conf"
def start(options, conf):
CODEMUXCONF="/etc/codemux/codemux.conf"
def start(options, conf):
- logger.log("codemux plugin starting up...")
+ logger.log("codemux
:
plugin starting up...")
def GetSlivers(data, config, plc = None):
"""
def GetSlivers(data, config, plc = None):
"""
@@
-35,6
+35,10
@@
def GetSlivers(data, config, plc = None):
if slicesinconf.has_key("root"): _writeconf = False
else: _writeconf = True
if slicesinconf.has_key("root"): _writeconf = False
else: _writeconf = True
+ if 'slivers' not in data:
+ logger.log("codemux.GetSlivers: could not find the slivers keyin data (PLC connection down?) - IGNORED")
+ return
+
# Parse attributes and update dict of scripts
for sliver in data['slivers']:
for attribute in sliver['attributes']:
# Parse attributes and update dict of scripts
for sliver in data['slivers']:
for attribute in sliver['attributes']:
@@
-141,6
+145,7
@@
def isRunning():
def restartService():
def restartService():
+ if not os.path.exists("/etc/init.d/codemux"): return
logger.log("codemux: Restarting codemux service")
if isRunning():
logger.log_call("/etc/init.d/codemux","condrestart")
logger.log("codemux: Restarting codemux service")
if isRunning():
logger.log_call("/etc/init.d/codemux","condrestart")
@@
-149,6
+154,7
@@
def restartService():
def startService():
def startService():
+ if not os.path.exists("/etc/init.d/codemux"): return
if not isRunning():
logger.log("codemux: Starting codemux service")
logger.log_call("/etc/init.d/codemux", "start")
if not isRunning():
logger.log("codemux: Starting codemux service")
logger.log_call("/etc/init.d/codemux", "start")
@@
-156,6
+162,7
@@
def startService():
def stopService():
def stopService():
+ if not os.path.exists("/etc/init.d/codemux"): return
if isRunning():
logger.log("codemux: Stopping codemux service")
logger.log_call("/etc/init.d/codemux", "stop")
if isRunning():
logger.log("codemux: Stopping codemux service")
logger.log_call("/etc/init.d/codemux", "stop")