[icinga-checkins] icinga.org: icinga-core/rbartels/cgi: sched_down.pl: fixed exit from procedure

git at icinga.org git at icinga.org
Thu Aug 9 18:04:46 CEST 2012


Module: icinga-core
Branch: rbartels/cgi
Commit: 233278a2c983d26451034b842aef85652a41c350
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=233278a2c983d26451034b842aef85652a41c350

Author: Wolfgang <wnd at gmx.net>
Date:   Fri Jul 13 18:25:50 2012 +0200

sched_down.pl: fixed exit from procedure

---

 contrib/downtimes/sched_down.pl |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/contrib/downtimes/sched_down.pl b/contrib/downtimes/sched_down.pl
index 0a98647..64a6a1b 100644
--- a/contrib/downtimes/sched_down.pl
+++ b/contrib/downtimes/sched_down.pl
@@ -32,6 +32,7 @@
 # 2012.03.21:  0.07 bugfix: fix end date check; splitted code
 # 2012.03.22:  0.08 bugfix: set author/comment if blank
 #                   enable no blank before opening brace (2nd try)
+# 2012.07.13:  0.09 bugfix: fix exit from procedure
 
 use strict;
 use Getopt::Long qw(:config no_ignore_case bundling);
@@ -50,7 +51,7 @@ EOT
 #
 
 my $creator = "2012 Icinga Team";
-my $version = "0.08";
+my $version = "0.09";
 my $script  = "sched_down.pl";
 
 my $cFile = "/usr/local/icinga/etc/icinga.cfg";
@@ -847,7 +848,7 @@ sub set_cmd {
 	if ("$h;$s" =~ /;$/) {	# no service_description
 		if ($hg) {	# host_groups defined
 			my @member = split (/,/,$hg{$hg}->{members});
-			next if (already_planned (\@member,"HG",1,$key,$key2,$duration));
+			return 1 if (already_planned (\@member,"HG",1,$key,$key2,$duration));
 			$extcmd = "SCHEDULE_HOSTGROUP_HOST_DOWNTIME;$hg;$data";
 			push @$cmd, $extcmd;
 			$pDowntimes{"$hg;;$dt->{start_ts};$dt->{end_ts}"} = $extcmd;





More information about the icinga-checkins mailing list