Beispiel #1
0
def framework_log_full(fid, log_type):
    sid = get_slave().id
    if sid != -1:
        dir = "%s/slave-%s/fw-%s" % (work_dir, sid, fid)
        i = max(os.listdir(dir))
        exec_dir = "%s/slave-%s/fw-%s/%s" % (work_dir, sid, fid, i)
        send_file(log_type, root=exec_dir, guessmime=False, mimetype="text/plain")
    else:
        abort(403, "Slave not yet registered with master")
Beispiel #2
0
def framework_log_tail(fid, log_type, lines):
    bottle.response.content_type = "text/plain"
    sid = get_slave().id
    if sid != -1:
        dir = "%s/slave-%s/fw-%s" % (work_dir, sid, fid)
        i = max(os.listdir(dir))
        filename = "%s/slave-%s/fw-%s/%s/%s" % (work_dir, sid, fid, i, log_type)
        return commands.getoutput("tail -%s %s" % (lines, filename))
    else:
        abort(403, "Slave not yet registered with master")
Beispiel #3
0
def framework_log_tail(fid, log_type, lines):
    bottle.response.content_type = 'text/plain'
    sid = get_slave().id
    if sid != -1:
        dir = '%s/slave-%s/fw-%s' % (work_dir, sid, fid)
        i = max(os.listdir(dir))
        filename = '%s/slave-%s/fw-%s/%s/%s' % (work_dir, sid, fid, i,
                                                log_type)
        return commands.getoutput('tail -%s %s' % (lines, filename))
    else:
        abort(403, 'Slave not yet registered with master')
Beispiel #4
0
def framework_log_full(fid, log_type):
    sid = get_slave().id
    if sid != -1:
        dir = '%s/slave-%s/fw-%s' % (work_dir, sid, fid)
        i = max(os.listdir(dir))
        exec_dir = '%s/slave-%s/fw-%s/%s' % (work_dir, sid, fid, i)
        send_file(log_type,
                  root=exec_dir,
                  guessmime=False,
                  mimetype='text/plain')
    else:
        abort(403, 'Slave not yet registered with master')