From efd077b5ba92b37ea17f959af8da78b9daeb9f57 Mon Sep 17 00:00:00 2001 From: Mikael Nordin Date: Fri, 31 Mar 2017 16:41:15 +0200 Subject: [PATCH] The object needs to know its own name The object needs to know its own name stored in a read/write field --- SU/API/Icinga2.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SU/API/Icinga2.pm b/SU/API/Icinga2.pm index 97c82fd..052b9b1 100644 --- a/SU/API/Icinga2.pm +++ b/SU/API/Icinga2.pm @@ -210,6 +210,9 @@ sub export { } my @results; foreach my $object ( @{ $result->{results} } ) { + # The object needs to know its own name stored in a read/write field + $object->{attrs}{vars}{__export_name} = $object->{attrs}{__name}; + my %hash; foreach my $key (sort @keys) { $hash{attrs}{$key} = $object->{attrs}{$key};