From fc9126aefa30db661988725afd1272d0dac5eeb4 Mon Sep 17 00:00:00 2001 From: dbs Date: Thu, 1 Nov 2007 23:52:32 +0000 Subject: [PATCH] Add check for expected hostname in section. git-svn-id: svn://svn.open-ils.org/ILS/trunk@7967 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/support-scripts/settings-tester.pl | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/support-scripts/settings-tester.pl b/Open-ILS/src/support-scripts/settings-tester.pl index a9e01b5af7..25303de639 100755 --- a/Open-ILS/src/support-scripts/settings-tester.pl +++ b/Open-ILS/src/support-scripts/settings-tester.pl @@ -88,6 +88,9 @@ print "\nChecking database connections\n"; my @databases = $osrfxml->findnodes('//database'); foreach my $database (@databases) { my $db_name = $database->findvalue("./db"); + if (!$db_name) { + $db_name = $database->findvalue("./name"); + } my $db_host = $database->findvalue("./host"); my $db_port = $database->findvalue("./port"); my $db_user = $database->findvalue("./user"); @@ -147,9 +150,29 @@ foreach my $driver_node (@drivers) { $output .= $result; } - +print "\nChecking libdbi and libdbi-drivers\n"; $output .= check_libdbd(); +print "\nChecking hostname\n"; +my @hosts = $osrfxml->findnodes('/opensrf/hosts/*'); +foreach my $host (@hosts) { + next unless $host->nodeType == XML::LibXML::XML_ELEMENT_NODE; + my $osrfhost = $host->nodeName; + my $he; + if ($osrfhost ne $hostname && $osrfhost ne "localhost") { + $result = " * ERROR: expected hostname '$hostname', found '$osrfhost' in section of opensrf.xml\n"; + warn $result; + $he = 1; + } elsif ($osrfhost eq "localhost") { + $result = " * OK: found hostname 'localhost' in section of opensrf.xml\n"; + } else { + $result = " * OK: found hostname '$hostname' in section of opensrf.xml\n"; + } + print $result unless $he; + $output .= $result; +} + + if ($gather) { get_debug_info( $tmpdir, $log_dir, $conf_dir, $perloutput, $output ); } -- 2.11.0