don't read host properties if not required

This commit is contained in:
Michael Kuzmin 2018-10-31 15:35:39 +03:00
parent 26cbcaed46
commit d641a78fb3
1 changed files with 1 additions and 1 deletions

View File

@ -100,7 +100,7 @@ func (d *Driver) CreateVM(config *CreateConfig) (*VirtualMachine, error) {
} }
var host *object.HostSystem var host *object.HostSystem
if config.Host != "" { if config.Cluster != "" && config.Host != "" {
h, err := d.FindHost(config.Host) h, err := d.FindHost(config.Host)
if err != nil { if err != nil {
return nil, err return nil, err