From e942ada8af8b54bb34b9a5a3a7ab34e7ae7ca347 Mon Sep 17 00:00:00 2001 From: Tobi Oetiker Date: Wed, 16 Apr 2008 21:20:48 +0000 Subject: complain properly when the secrets file can not be read --- lib/Smokeping/Master.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/Smokeping/Master.pm') diff --git a/lib/Smokeping/Master.pm b/lib/Smokeping/Master.pm index f8704a0..9a78a31 100644 --- a/lib/Smokeping/Master.pm +++ b/lib/Smokeping/Master.pm @@ -210,8 +210,11 @@ sub get_secret { close $hand; return $1; } - } - warn "WARNING: Opening $cfg->{Slaves}{secrets}: $!\n"; + } else { + print "Content-Type: text/plain\n\n"; + print "WARNING: Opening secrets file $cfg->{Slaves}{secrets}: $!\n"; + return '__HORRIBLE_INLINE_SIGNALING__'; + } return; } @@ -227,6 +230,7 @@ sub answer_slave { my $q = shift; my $slave = $q->param('slave'); my $secret = get_secret($cfg,$slave); + return if $secret eq '__HORRIBLE_INLINE_SIGNALING__'; if (not $secret){ print "Content-Type: text/plain\n\n"; print "WARNING: No secret found for slave ${slave}\n"; -- cgit v1.2.3-24-g4f1b