[Bps-public-commit] SD branch, master, updated. 0.74-74-g075fac4

Christine Spang spang at bestpractical.com
Sun Feb 20 20:10:08 EST 2011


The branch, master has been updated
       via  075fac40b884fe7a33b62edeb3b58f27e4038717 (commit)
      from  a15c07fbe351af09e96b4b6c9bf6c1e36918b3e9 (commit)

Summary of changes:
 lib/App/SD/Replica/rt/PullEncoder.pm |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 075fac40b884fe7a33b62edeb3b58f27e4038717
Author: Christine Spang <christine at debian.org>
Date:   Sun Feb 20 20:02:47 2011 -0500

    squelch chatty RT::Client::REST warnings when pulling from RT

diff --git a/lib/App/SD/Replica/rt/PullEncoder.pm b/lib/App/SD/Replica/rt/PullEncoder.pm
index 371c657..e3d22d5 100644
--- a/lib/App/SD/Replica/rt/PullEncoder.pm
+++ b/lib/App/SD/Replica/rt/PullEncoder.pm
@@ -82,6 +82,9 @@ sub find_matching_tickets {
         $self->sync_source->log( "Skipping all tickets not updated since " . $before->iso8601 );
     }
     return [map {
+        Prophet::CLI->end_pager();
+        # squelch chatty RT::Client::REST "Unknown key" warnings unless debugging turned on
+        local $SIG{__WARN__} = sub { $self->sync_source->log_debug(@_) };
         my $hash = $self->sync_source->rt->show( type => 'ticket', id => $_ );
         $hash->{id} =~ s|^ticket/||g;
         $hash
@@ -425,7 +428,12 @@ sub resolve_user_id_to {
     return undef unless $id;
 
     local $@;
-    my $user = eval { RT::Client::REST::User->new( rt => $self->sync_source->rt, id => $id )->retrieve};
+    my $user = eval {
+       Prophet::CLI->end_pager();
+       # squelch chatty RT::Client::REST "Unknown key" warnings
+       local $SIG{__WARN__} = sub { $self->sync_source->log_debug(@_) };
+       RT::Client::REST::User->new( rt => $self->sync_source->rt, id => $id )->retrieve;
+    };
     if ( my $err = $@ ) {
         warn $err;
         return $attr eq 'name' ? 'Unknown user' : 'unknown at localhost';

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list