From f74bf44cbc97834246b5aa9d397f5c50360bb6c2 Mon Sep 17 00:00:00 2001 From: dbs Date: Mon, 8 Nov 2010 21:03:55 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@2056 9efc2488-bf62-4759-914b-345cdb29e865 --- bin/opensrf-perl.pl.in | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/opensrf-perl.pl.in b/bin/opensrf-perl.pl.in index cc99759..665fcb4 100755 --- a/bin/opensrf-perl.pl.in +++ b/bin/opensrf-perl.pl.in @@ -100,8 +100,13 @@ sub do_init { 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; -- 2.43.2