[Rt-commit] r7565 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Thu Apr 19 09:47:53 EDT 2007


Author: ruz
Date: Thu Apr 19 09:47:52 2007
New Revision: 7565

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm

Log:
 r4988 at cubic-pc:  cubic | 2007-04-19 04:16:51 +0400
 * set Keyword in one place


Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm	Thu Apr 19 09:47:52 2007
@@ -788,7 +788,6 @@
             my $key_id = $args;
             my %res = (
                 Operation => 'PassphraseCheck',
-                Keyword   => $keyword,
                 Status    => $keyword eq 'BAD_PASSPHRASE'? 'BAD' : 'DONE',
                 Key       => $key_id,
             );
@@ -826,7 +825,6 @@
                 Operation => 'Decrypt',
                 Status    => 'ERROR',
                 Message   => 'Decryption failed',
-                Keyword   => $keyword,
             );
             push @res, \%res;
         }
@@ -835,7 +833,6 @@
                 Operation => 'Decrypt',
                 Status    => 'DONE',
                 Message   => 'Decryption process succeeded',
-                Keyword   => $keyword,
             );
             push @res, \%res;
         }
@@ -845,7 +842,6 @@
                 Operation => 'Decrypt',
                 Status    => 'DONE',
                 Message   => "The message is encrypted to $key",
-                Keyword   => 'ENC_TO',
                 Key       => $key,
                 KeyLength => $key_length,
                 Algorithm => $alg,
@@ -861,7 +857,6 @@
                 Operation => 'KeyCheck',
                 Status    => 'MISSING',
                 Message   => ucfirst( $type ) ." key $key is not available",
-                Keyword   => $keyword,
                 Key       => $key,
             );
             $user_hint{ $key } ||= {};
@@ -945,7 +940,6 @@
             my $reason = $inv_recp_reason{$rcode} || 'Unknown';
             push @res, {
                 Operation => 'RecipientsCheck',
-                Keyword => 'INV_RECP',
                 Status  => 'ERROR',
                 Message => "Recipient '$recipient' is unusable, the reason is '$reason'",
                 Recipient => $recipient,
@@ -958,12 +952,16 @@
             my $reason = $nodata_what{ $rcode } || 'Unknown';
             push @res, {
                 Operation  => 'Data',
-                Keyword    => 'NODATA',
                 Message    => "No data has been found. The reason is '$reason'",
                 ReasonCode => $rcode,
                 Reason     => $reason,
             };
         }
+        else {
+            $RT::Logger->warning("Keyword $keyword is unknown");
+            next;
+        }
+        $res[-1]{'Keyword'} = $keyword unless $res[-1]{'Keyword'};
     }
     return @res;
 }


More information about the Rt-commit mailing list