[Opensrf-commits] r2029 - trunk/src/perl/lib/OpenSRF/Utils (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Sep 28 13:35:30 EDT 2010


Author: dbs
Date: 2010-09-28 13:35:26 -0400 (Tue, 28 Sep 2010)
New Revision: 2029

Modified:
   trunk/src/perl/lib/OpenSRF/Utils/SettingsParser.pm
Log:
Work around a Net::Domain bug that can result in fqdn's like foo.example.com,bar.com

The bug manifested when trying to run autogen.sh, with the output:
Updating fieldmapper
No Response from settings server...going to sleep

This was because SettingsParser was generating invalid XPath and consquently
errors in the opensrf.settings service; with no response, the attempt to run
autogen.sh would die.

This workaround splits the fqdn on commas and tries each possible domain in
the server setting XPath. Long term we either need to wait for Net::Domain
bug #60729 (https://rt.cpan.org/Public/Bug/Display.html?id=60729) to be
resolved, or consider alternatives.


Modified: trunk/src/perl/lib/OpenSRF/Utils/SettingsParser.pm
===================================================================
--- trunk/src/perl/lib/OpenSRF/Utils/SettingsParser.pm	2010-09-28 00:04:19 UTC (rev 2028)
+++ trunk/src/perl/lib/OpenSRF/Utils/SettingsParser.pm	2010-09-28 17:35:26 UTC (rev 2029)
@@ -134,7 +134,13 @@
 # returns the full config hash for a given server
 sub get_server_config {
 	my( $self, $server ) = @_;
-	my $xpath = "/opensrf/default|/opensrf/hosts/$server";
+
+    # Work around a Net::Domain bug that can result in fqdn like foo.example.com,bar.com
+    my @servers = split /,/, $server;
+    my $xpath = "/opensrf/default";
+    foreach (@servers) {
+        $xpath .= "|/opensrf/hosts/$_";
+    }
 	return $self->_get( $xpath );
 }
 



More information about the opensrf-commits mailing list