From a60943bc1b28696459ea5a28df9874083b9f0966 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 19 Jan 2016 08:55:49 +0000 Subject: [PATCH] Bug 15188: Do not remove unused auths if zebra is not reachable Other conn errors should be checked (wrong user/pwd, etc.) Signed-off-by: Jonathan Druart Signed-off-by: Brendan A Gallagher --- misc/migration_tools/remove_unused_authorities.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/misc/migration_tools/remove_unused_authorities.pl b/misc/migration_tools/remove_unused_authorities.pl index af8897af46..eec2155d32 100755 --- a/misc/migration_tools/remove_unused_authorities.pl +++ b/misc/migration_tools/remove_unused_authorities.pl @@ -45,8 +45,11 @@ if ($test) { print "testing only, authorities will not be deleted.\n"; } -if (C4::Context->Zconn("biblioserver",0)->errcode() == 10000) { +my $errZebraConnection = C4::Context->Zconn("biblioserver",0)->errcode(); +if ( $errZebraConnection == 10000 ) { die "Zebra server seems not to be available. This script needs Zebra runs." +} elsif ( $errZebraConnection ) { + die "Error from Zebra: $errZebraConnection"; } my $dbh=C4::Context->dbh; -- 2.39.5