Exemplo n.º 1
0
func (d *Driver) getHostSystem(f *find.Finder, ctx context.Context) (hs *object.HostSystem, err error) {
	// HostSystem
	if d.HostSystem != "" {
		// Find specified HostSystem
		hs, err = f.HostSystem(ctx, d.HostSystem)
		if err != nil {
			return hs, err
		}
	} else {
		// Find default HostSystem
		hs, err = f.DefaultHostSystem(ctx)
		if err != nil {
			return hs, err
		}
	}
	log.Debug("HostSystem found: ", hs)
	return hs, nil
}