X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fcodemux.py;h=aad28b113432640438443bde122206255ac8a42b;hb=refs%2Fheads%2F1.7;hp=ce69e4a13b1865f29558a7028567fe3dec32ef47;hpb=4f04767359981da2906f6c4a0315e5da147db3bf;p=nodemanager.git diff --git a/plugins/codemux.py b/plugins/codemux.py index ce69e4a..aad28b1 100644 --- a/plugins/codemux.py +++ b/plugins/codemux.py @@ -16,10 +16,7 @@ def start(options, config): def GetSlivers(data): - """ - For each sliver with the codemux attribute, parse out "host,port" - and make entry in conf. Restart service after. - """ + """For each sliver with the codemux attribute, parse out "host,port" and make entry in conf. Restart service after.""" logger.log("codemux: Starting.", 2) # slices already in conf slicesinconf = parseConf() @@ -33,7 +30,7 @@ def GetSlivers(data): # Parse attributes and update dict of scripts for sliver in data['slivers']: for attribute in sliver['attributes']: - if attribute['tagname'] == 'codemux': + if attribute['name'] == 'codemux': # add to conf. Attribute is [host, port] params = {'host': attribute['value'].split(",")[0], 'port': attribute['value'].split(",")[1]} @@ -121,13 +118,4 @@ def parseConf(conf = CODEMUXCONF): def restartService(): logger.log("codemux: Restarting codemux service") - os.system("/etc/init.d/codemux stop") - f = os.popen("/sbin/pidof codemux") - tmp = f.readlines() - f.close() - if len(tmp) > 0: - pids = tmp[0].rstrip("\n").split() - for pid in pids: - logger.log("codemux: Killing stalled pid %s" % pid, 2) - os.kill(pid, 9) - os.system("/etc/init.d/codemux start") + os.system("/etc/init.d/codemux condrestart")