Jgreen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/130329

Change subject: add 'rebuild' mode to otrs mail exporter, for use when 
retraining Bayes database
......................................................................

add 'rebuild' mode to otrs mail exporter, for use when retraining Bayes database

Change-Id: Ic7fe238e6924d0983c2af536cda95c95454f013d
---
M files/otrs/otrs.TicketExport2Mbox.pl
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/29/130329/1

diff --git a/files/otrs/otrs.TicketExport2Mbox.pl 
b/files/otrs/otrs.TicketExport2Mbox.pl
index c0ac609..c9b40ec 100755
--- a/files/otrs/otrs.TicketExport2Mbox.pl
+++ b/files/otrs/otrs.TicketExport2Mbox.pl
@@ -60,6 +60,7 @@
        'mbox=s'              => \$Mbox,
        'TicketNumber=s{,}'   => \@TicketNumbers,
        'TicketID=s{,}'       => \@TicketIDs,
+       'rebuild'             => \$Rebuild,
 );
 
 # when called from Generic Agent, ARG[0] is TicketNumber and ARG[1] is TicketID
@@ -100,7 +101,7 @@
        );
        if (($HistoryData{'Queue'} eq 'Junk') and ($HistoryData{'CreateQueue'} 
eq 'Junk')) {
                printlog("Skip TicketID $TicketID, it was already autoqueued to 
Junk.",'debug');
-       } elsif ($HistoryData{'State'} =~ /^closed successful$/) {
+       } elsif (($HistoryData{'State'} =~ /^closed successful$/) and (! 
defined $Rebuild)) {
                printlog("Skip TicketID $TicketID, it is already 'Closed 
successful'.",'debug');
        } else {
                my @TicketArticleIds = 
$CommonObject{TicketObject}->ArticleIndex(
@@ -166,6 +167,7 @@
                "  --help                          display this option help\n" .
                "  --mbox /path/to/mbox            mbox output file (default 
$Mbox)\n" .
                "  --close                         change ticket status to 
'closed successful'\n" .
+               "  --rebuild                       run all messages for Bayes 
rebuild (don't skip already-closed messages)\n" .
                "  --TicketID no1 no2 no3          export messages by 
TicketID\n" .
                "  --TicketNumber no1 no2 no3      export messages by 
TicketNumber\n\n";
     exit;

-- 
To view, visit https://gerrit.wikimedia.org/r/130329
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic7fe238e6924d0983c2af536cda95c95454f013d
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Jgreen <jgr...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to