LP#1384740 marc_stream_importer no-import repairs
authorBill Erickson <berickxx@gmail.com>
Tue, 23 Jun 2015 20:17:07 +0000 (16:17 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 4 Nov 2015 20:32:41 +0000 (20:32 +0000)
Report "no_import" records, which occur when a record fails to import
due to merge rules, quality rules, etc. (i.e. non-error conditions) as
failures to the client.

Also deprecates the "--queue" parameter, suggesting instead to use
--bib-queue or --auth-queue.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/support-scripts/marc_stream_importer.pl

index dbd1af4..c62ec9e 100755 (executable)
@@ -84,6 +84,7 @@ my $import_no_match;
 my $auto_overlay_exact;
 my $auto_overlay_1match;
 my $auto_overlay_best_match;
+my $deprecated_queue;
 
 
 
@@ -98,7 +99,8 @@ GetOptions(
     'spoolfile=s'           => \$spoolfile,
     'wait=i'                => \$wait_time,
     'merge-profile=i'       => \$bib_merge_profile,
-    'queue=i'               => \$bib_queue,
+    'queue=i'               => \$deprecated_queue,
+    'bib-queue=i'           => \$bib_queue,
     'source=i'              => \$bib_source,
     'auth-merge-profile=i'  => \$auth_merge_profile,
     'auth-queue=i'          => \$auth_queue,
@@ -223,6 +225,11 @@ if ($auto_overlay_best_match) {
     warn "\nauto-overlay-best-match is deprecated; use bib-auto-overlay-best-match\n";
     $bib_auto_overlay_best_match = $auto_overlay_best_match;
 }
+if ($deprecated_queue) {
+    warn "\n--queue is deprecated; use --bib-queue\n";
+    $bib_queue = $deprecated_queue;
+}
+
 
 die "--username AND --password required.  --help for more info.\n" 
     unless $username and $password;
@@ -349,6 +356,14 @@ sub import_queued_records {
                 $logger->error(Dumper($data->{err_event}));
                 $failed++;
 
+            } elsif ($data->{no_import}) {
+                # no errors, just didn't import, because of rules.
+
+                $failed++;
+                $logger->info(
+                    "record failed to satisfy Vandelay merge/quality/etc. ".
+                    "requirements: " . ($data->{imported} || ''));
+
             } else {
                 push(@cleanup_recs, $data->{imported}) if $data->{imported};
             }