From: dbs Date: Mon, 8 Nov 2010 21:03:55 +0000 (+0000) Subject: Make opensrf-perl.pl handle missing configuration for services more gracefully X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f74bf44cbc97834246b5aa9d397f5c50360bb6c2;p=working%2FOpenSRF.git 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 --- 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;