Пример #1
0
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
Пример #2
0
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
Пример #3
0
        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
Пример #4
0
        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