handle esx without cluster

This commit is contained in:
Colin Gagnaire 2019-08-14 10:34:52 +02:00
parent 11d14aaccd
commit 4ec0b5677d
1 changed files with 3 additions and 1 deletions

View File

@ -100,7 +100,9 @@ sub run {
foreach my $child (@{$childs}) {
next if (!$child->childEntity);
my %types = map { $_ => 1 } @{$child->childType};
next if (!defined($types{ComputeResource}));
my %entities = map { $_->type => 1 } @{$child->childEntity};
next if (!defined($types{ComputeResource}) || (!defined($entities{ClusterComputeResource}) &&
!defined($entities{ComputeResource})));
my @properties = ('name', 'host');
my $clusters = centreon::vmware::common::get_views($self->{connector}, \@{$child->childEntity}, \@properties);