mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
Merge pull request #7902 from rainzm/cloudaccount/opt_fix
fix(esxi): return when host.Vm is empty
This commit is contained in:
@@ -656,6 +656,9 @@ func (cli *SESXiClient) HostVmIPs(ctx context.Context) (map[string]string, []SSi
|
||||
}
|
||||
|
||||
func (cli *SESXiClient) vmIPs(host *mo.HostSystem) ([]SSimpleVM, error) {
|
||||
if len(host.Vm) == 0 {
|
||||
return []SSimpleVM{}, nil
|
||||
}
|
||||
var vms []mo.VirtualMachine
|
||||
err := cli.references2Objects(host.Vm, VM_PROPS, &vms)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user