[Opensrf-commits] r2056 - trunk/bin (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Nov 8 16:04:00 EST 2010


Author: dbs
Date: 2010-11-08 16:03:55 -0500 (Mon, 08 Nov 2010)
New Revision: 2056

Modified:
   trunk/bin/opensrf-perl.pl.in
Log:
Make opensrf-perl.pl handle missing configuration for services more gracefully

As we might want to ship configuration files with commented out sections,
this will alert the user that a service was listed in the hosts section
but the configuration for that service could not be found.


Modified: trunk/bin/opensrf-perl.pl.in
===================================================================
--- trunk/bin/opensrf-perl.pl.in	2010-11-05 20:57:43 UTC (rev 2055)
+++ trunk/bin/opensrf-perl.pl.in	2010-11-08 21:03:55 UTC (rev 2056)
@@ -100,8 +100,13 @@
     if($apps) {
         $apps = [$apps] unless ref $apps;
         for my $app (@$apps) {
-            push(@hosted_services, $app) 
-                if $sclient->config_value('apps', $app, 'language') =~ /perl/i;
+            if (!$sclient->config_value('apps', $app)) {
+                msg("Service '$app' is listed for this host, but there is no configuration for it in $opt_config");
+                next;
+            }
+            if ($sclient->config_value('apps', $app, 'language') =~ /perl/i) {
+                push(@hosted_services, $app);
+            }
         }
     }
     return 1;



More information about the opensrf-commits mailing list