Config Conversion: Skip ARGn macros on Command object export.

This commit is contained in:
Michael Friedrich 2013-09-10 14:04:18 +02:00
parent 4d95eaa6c5
commit dc0f2e2fa9
1 changed files with 1 additions and 3 deletions

View File

@ -1094,15 +1094,13 @@ sub dump_command_2x {
if(defined($command_2x->{'__I2CONVERT_COMMAND_MACROS'}) && $command_2x->{'__I2CONVERT_COMMAND_MACROS'} != 0) { if(defined($command_2x->{'__I2CONVERT_COMMAND_MACROS'}) && $command_2x->{'__I2CONVERT_COMMAND_MACROS'} != 0) {
dump_config_line($icinga2_cfg, "\tmacros = {"); dump_config_line($icinga2_cfg, "\tmacros = {");
foreach my $cmd_arg (keys %{$command_2x->{'__I2CONVERT_COMMAND_MACROS'}}) { foreach my $cmd_arg (keys %{$command_2x->{'__I2CONVERT_COMMAND_MACROS'}}) {
next if $cmd_arg =~ /ARG\d+/;
dump_config_line($icinga2_cfg, "\t\t$cmd_arg = \"$command_2x->{'__I2CONVERT_COMMAND_MACROS'}->{$cmd_arg}\","); dump_config_line($icinga2_cfg, "\t\t$cmd_arg = \"$command_2x->{'__I2CONVERT_COMMAND_MACROS'}->{$cmd_arg}\",");
} }
dump_config_line($icinga2_cfg, "\t},"); dump_config_line($icinga2_cfg, "\t},");
} }
dump_config_line($icinga2_cfg, ""); dump_config_line($icinga2_cfg, "");
dump_config_line($icinga2_cfg, "");
dump_config_line($icinga2_cfg, "}"); dump_config_line($icinga2_cfg, "}");
dump_config_line($icinga2_cfg, "\n"); dump_config_line($icinga2_cfg, "\n");
} }