def get_supervisor_status(name): """ Get the status of a supervisor service """ res = subproc("supervisorctl status %s" % name) status = True if res['stdout'].lower().find("running") > -1 else False return status
def put(self, name): """ Return the list of parameter for a specifc pipeline """ data = request.get_json() status = bool(data.get('status')) cmd = "start" if status else "stop" res = subproc("supervisorctl %s %s" % (cmd, name)) print res['stdout'] ret_code = 200 if res['stdout'].lower().find(cmd) > -1 else 500 return {"msg": res['stdout']}, ret_code
def put(self, name): """ Return the list of parameter for a specifc pipeline """ data = request.get_json() status = bool(data.get('status')) cmd = "start" if status else "stop" res = subproc("supervisorctl %s %s" % (cmd, name)) print res['stdout'] ret_code = 200 if res['stdout'].lower().find(cmd) > -1 else 500 return {"msg" : res['stdout']}, ret_code