Ejemplo n.º 1
0
def c_clean(p, h, args):
    if len(args) > 0:
        r = h.select_runs(args.pop());
    else:
        r = h.select_runs();
    
    for f in r:
        m = Monitor( h, f );
        result = m.communicate( commands.Ping() );
        
        if result and isinstance( result, commands.Pong ):
            p.info( "Got Pong:", f )
            continue;
        
        p.info( "Timeout, removing:", f )
        m.remove();
    
    if len(r) == 0:
        p.info( "Nothing to clean" )
Ejemplo n.º 2
0
def c_info(p, h, args):
    if len(args) == 0:
        return 1;
    
    id = match_one_running( p, h, args.pop() );

    if not id:
        return 1;
    
    m = Monitor(h, id);
    result = m.communicate(commands.Info());
    
    if result:
        p.format("id:      ?", result.id );
        p.format("init:    ?", h.get_init( result.init ).path );
        p.format("pid:     ?", result.pid );
        p.format("running: ?", get_time( result.started ) );
    else:
        p.info( "Unable to get info" )