IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28834


Ignore:
Timestamp:
Aug 3, 2010, 9:30:38 AM (16 years ago)
Author:
rhenders
Message:

Added method to check for dodgy responses from pantasks_client

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/czartool/Pantasks.pm

    r28829 r28834  
    2020        "summitcopy"
    2121        );
    22 
    2322
    2423###########################################################################
     
    6160###########################################################################
    6261#
     62# Checks for a meaningful response from pantasks client
     63#
     64###########################################################################
     65sub outputOk {
     66    my ($self, $output) = @_;
     67
     68    if (
     69            $output =~ m/.*show\.labels.*/i ||
     70            $output =~ m/.*Connection reset by peer.*/i ||
     71            $output =~ m/.*server is busy.*/i ) {
     72
     73        print "* WARNING: pantasks returned '$output'\n";
     74        return 0;
     75    }
     76    return 1;
     77}
     78
     79###########################################################################
     80#
    6381# Gets labels for provided server
    6482#
     
    7795        if ($line =~ m/pantasks:\s+(.*)/) {
    7896
    79             # HACK quit if we get 'show.labels: Command not found.'
    80             if ($1 =~ m/.*show\.labels.*/i) {return \@labels;};
    81             # HACK quit if we get 'Connection reset by peer'
    82             if ($1 =~ m/.*Connection reset by peer.*/i) {return \@labels;};
    83             # HACK quit if we get 'server is busy' message
    84             if ($1 =~ m/.*server is busy.*/i) {return \@labels;};
     97            if (!$self->outputOk($1)) {return \@labels;}
     98
    8599            # HACK to get around 'dummy' label in stdscience
    86100            if ($1 !~ m/.*dummy.*/) {push(@labels, $1);};
Note: See TracChangeset for help on using the changeset viewer.