add empty tags array to discovery by default

This commit is contained in:
garnier-quentin 2022-08-10 10:30:30 +02:00
parent 8458e89adc
commit 7753ac3738
1 changed files with 2 additions and 2 deletions

View File

@ -172,8 +172,8 @@ sub run {
$esx{datacenter} = $datacenter->name;
$esx{cluster} = $cluster->name;
$esx{custom_attributes} = $customValuesEsx;
$esx{tags} = [];
if (defined($tags)) {
$esx{tags} = [];
$esx{tags} = $tags->{esx}->{ $esx->{mo_ref}->{value} } if (defined($tags->{esx}->{ $esx->{mo_ref}->{value} }));
}
@ -226,8 +226,8 @@ sub run {
$entry->{cluster} = $cluster->name;
$entry->{custom_attributes} = $customValuesVm;
$entry->{esx} = $esx->name;
$entry->{tags} = [];
if (defined($tags)) {
$entry->{tags} = [];
$entry->{tags} = $tags->{vm}->{ $vm->{mo_ref}->{value} } if (defined($tags->{vm}->{ $vm->{mo_ref}->{value} }));
}