From cc1dbbca0ba0542a111a1da66480e7a9a7129ca1 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Thu, 12 Sep 2013 20:24:13 +0200 Subject: [PATCH] Config Conversion: Object macros start with name. refs #4700 --- tools/configconvert/Icinga2/Convert.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/configconvert/Icinga2/Convert.pm b/tools/configconvert/Icinga2/Convert.pm index 5e30aaea1..0c45baf75 100644 --- a/tools/configconvert/Icinga2/Convert.pm +++ b/tools/configconvert/Icinga2/Convert.pm @@ -854,7 +854,7 @@ sub resolve_macro_attribute { } else { # XXX this is way too modular to actually work with macros not having any underscores and other magic - if ($macro_name =~ /HOST(\w+)/) { + if ($macro_name =~ /^HOST(\w+)/) { $attr_name = lc $1; Icinga2::Utils::debug("MACRO RESOLVER: found Host attribute '$macro_name'."); @@ -872,7 +872,7 @@ sub resolve_macro_attribute { Icinga2::Utils::debug("MACRO RESOLVER: found $attr_name with value '$macro_value' on " . Dumper($obj)); return $macro_value; } - elsif ($macro_name =~ /SERVICE(\w+)/) { + elsif ($macro_name =~ /^SERVICE(\w+)/) { $attr_name = lc $1; # if this is a host object, this macro is invalid! XXX @@ -884,7 +884,7 @@ sub resolve_macro_attribute { Icinga2::Utils::debug("MACRO RESOLVER: found $attr_name with value '$macro_value' on " . Dumper($obj)); return $macro_value; } - elsif ($macro_name =~ /CONTACT(\w+)/) { + elsif ($macro_name =~ /^CONTACT(\w+)/) { $attr_name = lc $1; # XXX is that possible from command arguments? # http://docs.icinga.org/latest/en/macrolist.html#availabilitychart (NO) -- 2.40.0