X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fcodemux.py;h=f14fdc05e62687228bb1618fcb485067fa5c9f98;hb=49a4ce9cb926041815283409433793700ff386cd;hp=fa5311f6efd3667d8f3e9a9c642a34579c061da0;hpb=7e1b0c611c767f9e19a60afc9b14c9ad7cd40182;p=nodemanager.git diff --git a/plugins/codemux.py b/plugins/codemux.py index fa5311f..f14fdc0 100644 --- 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): - logger.log("codemux plugin starting up...") + logger.log("codemux: plugin starting up...") 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 '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']: @@ -141,6 +145,7 @@ def isRunning(): 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") @@ -149,12 +154,16 @@ def restartService(): 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") + logger.log_call("/sbin/chkconfig", "codemux", "on") 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") + logger.log_call("/sbin/chkconfig", "codemux", "off")