Changeset 926 for dasscm/trunk/usr/bin


Ignore:
Timestamp:
Jul 30, 2010, 6:45:47 PM (14 years ago)
Author:
joergs
Message:

supress plugin test outputs, also when combinied commands by &&, add increase output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dasscm/trunk/usr/bin/dasscm

    r924 r926  
    696696    my $command = shift;
    697697
    698     #print "executing command: " . $command . "\n";
    699 
    700     open( RESULT, "LANG=C " . $command . ' 2>&1 |' );
    701     my @result = <RESULT>;
    702     close(RESULT);
     698    if ($verbose) {
     699        print "executing command: " . $command . "\n";
     700    }
     701
     702    my @result;
     703    if(  open( RESULT, $command . ' 2>&1 |' ) ) {
     704        @result = <RESULT>;
     705        close(RESULT);
     706    }
    703707    my $retcode = $? >> 8;
    704708
    705     #print @result;
    706     #if( $retcode ) { print "return code: " . $retcode . "\n"; }
     709    if ($verbose) {
     710        print @result;
     711        if( $retcode ) { print "return code: " . $retcode . "\n"; }
     712    }
    707713
    708714    return ( $retcode, @result );
     
    790796        my $plugin_name = substr( $plugin, length("DASSCM_PLUGIN_CMD_") );
    791797        my $plugin_test = $config->{ 'DASSCM_PLUGIN_TEST_' . $plugin_name };
    792         ( my $rc_test, my @result_test ) = run_command($plugin_test);
    793798        if ($verbose) { print "Plugin $plugin_name: "; }
     799        # all plugins are executed with LANG settings C
     800        # bash -c is used, to supress all output
     801        # (otherwise there are problem with && commands)
     802        ( my $rc_test, my @result_test ) = run_command( "LANG=C bash -c " . $plugin_test);
    794803        if ( $rc_test != 0 ) {
    795804            if ($verbose) { print "skipped\n"; }
Note: See TracChangeset for help on using the changeset viewer.