From 6061473d23e79b18247494b8ceb3bc8739625576 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 18 Sep 2015 15:49:07 +0200 Subject: [PATCH] + fix custom mode choose (simple) --- centreon-plugins/centreon/plugins/script_custom.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/centreon/plugins/script_custom.pm b/centreon-plugins/centreon/plugins/script_custom.pm index a40fc933f..9a6df7c66 100644 --- a/centreon-plugins/centreon/plugins/script_custom.pm +++ b/centreon-plugins/centreon/plugins/script_custom.pm @@ -102,8 +102,8 @@ sub init { if (defined($self->{custommode_name}) && $self->{custommode_name} ne '') { $self->load_custom_mode(); - } elsif (scalar(%{$self->{custom_modes}}) == 1) { - $self->{custommode_name} = keys(%{$self->{custom_modes}})[0]; + } elsif (scalar(keys %{$self->{custom_modes}}) == 1) { + $self->{custommode_name} = (keys(%{$self->{custom_modes}}))[0]; $self->load_custom_mode(); } else { $self->{output}->add_option_msg(short_msg => "Need to specify '--custommode'.");