]> granicus.if.org Git - icinga2/commitdiff
Config Conversion: Object macros start with name.
authorMichael Friedrich <michael.friedrich@netways.de>
Thu, 12 Sep 2013 18:24:13 +0000 (20:24 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Thu, 12 Sep 2013 18:24:13 +0000 (20:24 +0200)
refs #4700

tools/configconvert/Icinga2/Convert.pm

index 5e30aaea17ab5176fa0785c972d6bcbdc044ba99..0c45baf751fd15fd88393d2d1da0d240106f9e99 100644 (file)
@@ -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)