From eff505e27f961f0923239c4d127e41d33a88ccf2 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Thu, 29 Aug 2013 15:22:52 +0200 Subject: [PATCH] Config Conversion: Skip user macros for non-command objects. --- tools/configconvert/Icinga2/ExportIcinga2Cfg.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/configconvert/Icinga2/ExportIcinga2Cfg.pm b/tools/configconvert/Icinga2/ExportIcinga2Cfg.pm index de4c1bfff..a6c982db2 100644 --- a/tools/configconvert/Icinga2/ExportIcinga2Cfg.pm +++ b/tools/configconvert/Icinga2/ExportIcinga2Cfg.pm @@ -301,6 +301,7 @@ sub dump_service_2x { if(defined($service_2x->{'__I2CONVERT_MACROS'}) && $service_2x->{'__I2CONVERT_MACROS'} != 0) { dump_config_line($icinga2_cfg, "\tmacros = {"); foreach my $macro_key (keys %{$service_2x->{'__I2CONVERT_MACROS'}}) { + next if $macro_key =~ /USER/; dump_config_line($icinga2_cfg, "\t\t$macro_key = \"$service_2x->{'__I2CONVERT_MACROS'}->{$macro_key}\","); } dump_config_line($icinga2_cfg, "\t},"); @@ -504,6 +505,7 @@ sub dump_host_2x { if(defined($host_2x->{'__I2CONVERT_MACROS'}) && $host_2x->{'__I2CONVERT_MACROS'} != 0) { dump_config_line($icinga2_cfg, "\tmacros = {"); foreach my $macro_key (keys %{$host_2x->{'__I2CONVERT_MACROS'}}) { + next if $macro_key =~ /USER/; dump_config_line($icinga2_cfg, "\t\t$macro_key = \"$host_2x->{'__I2CONVERT_MACROS'}->{$macro_key}\","); } dump_config_line($icinga2_cfg, "\t},"); @@ -677,6 +679,7 @@ sub dump_host_2x { if(defined($service_2x->{'__I2CONVERT_MACROS'}) && $service_2x->{'__I2CONVERT_MACROS'} != 0) { dump_config_line($icinga2_cfg, "\t\tmacros = {"); foreach my $macro_key (keys %{$service_2x->{'__I2CONVERT_MACROS'}}) { + next if $macro_key =~ /USER/; dump_config_line($icinga2_cfg, "\t\t\t$macro_key = \"$service_2x->{'__I2CONVERT_MACROS'}->{$macro_key}\","); } dump_config_line($icinga2_cfg, "\t\t},"); @@ -847,6 +850,7 @@ sub dump_user_2x { if(defined($user_2x->{'__I2CONVERT_MACROS'}) && $user_2x->{'__I2CONVERT_MACROS'} != 0) { dump_config_line($icinga2_cfg, "\tmacros = {"); foreach my $macro_key (keys %{$user_2x->{'__I2CONVERT_MACROS'}}) { + next if $macro_key =~ /USER/; dump_config_line($icinga2_cfg, "\t\t$macro_key = \"$user_2x->{'__I2CONVERT_MACROS'}->{$macro_key}\","); } dump_config_line($icinga2_cfg, "\t},"); -- 2.40.0