]> granicus.if.org Git - icinga2/commitdiff
config: Temporarily set hostname for services.
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 13 Sep 2013 11:05:55 +0000 (13:05 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 13 Sep 2013 11:05:55 +0000 (13:05 +0200)
tools/configconvert/Icinga2/Convert.pm

index 3e8a14be524eb06dcb7daef4be02821bc8ea28ea..113a6dec00100358fb0887e2d47574f0aae6f9aa 100644 (file)
@@ -1396,7 +1396,10 @@ sub convert_2x {
             # save all command args as macros
             my $arg_cnt = 1;
             foreach my $command_arg_1x (@command_args_1x) {
+                $obj_1x_service->{__I2CONVERT_SERVICE_HOSTNAME} = $service_host_name;
                 my $command_arg_2x = resolve_macros($cfg_obj_1x, $obj_1x_service, $command_arg_1x);
+                $obj_1x_service->{__I2CONVERT_SERVICE_HOSTNAME} = undef;
+
                 @$cfg_obj_2x{'service'}->{$service_cnt}->{'__I2CONVERT_MACROS'}->{"ARG" . $arg_cnt} = Icinga2::Utils::escape_str($command_arg_2x);
                 $arg_cnt++;
             }