func (hps SpaceHostPorts) InSpaces(spaces ...SpaceInfo) (SpaceHostPorts, bool) {
	if len(spaces) == 0 {
		logger.Errorf("host ports not filtered - no spaces given.")
		return hps, false
	}

	spaceInfos := SpaceInfos(spaces)
	var selectedHostPorts SpaceHostPorts
	for _, hp := range hps {
		if space := spaceInfos.GetByID(hp.SpaceID); space != nil {
			logger.Debugf("selected %q as a hostPort in space %q", hp.Value, space.Name)
			selectedHostPorts = append(selectedHostPorts, hp)
		}
	}

	if len(selectedHostPorts) > 0 {
		return selectedHostPorts, true
	}

	logger.Errorf("no hostPorts found in spaces %s", spaceInfos)
	return hps, false
}
// InSpaces returns the SpaceHostPorts that are in the input spaces.
InSpaces returns the SpaceHostPorts that are in the input spaces.
// InSpaces returns the SpaceHostPorts that are in the input spaces .
func (hps SpaceHostPorts) InSpaces(spaces ...SpaceInfo) (SpaceHostPorts, bool) {
	if len(spaces) == 0 {
		logger.Errorf("host ports not filtered - no spaces given.")
		return hps, false
	}
	spaceInfos := SpaceInfos(spaces)
	var selectedHostPorts SpaceHostPorts
	for _, hp := range hps {
		if space := spaceInfos.GetByID(hp.SpaceID); space != nil {
			logger.Debugf("selected %q as a hostPort in space %q", hp.Value, space.Name)
			selectedHostPorts = append(selectedHostPorts, hp)
		}
	}
	if len(selectedHostPorts) > 0 {
		return selectedHostPorts, true
	}
	logger.Errorf("no hostPorts found in spaces %s", spaceInfos)
	return hps, false
}
func ( hps SpaceHostPorts ) InSpaces ( spaces ... SpaceInfo ) ( SpaceHostPorts , bool ) { if len ( spaces ) == 0 { logger . Errorf ( " " ) return hps , false } spaceInfos := SpaceInfos ( spaces ) var selectedHostPorts SpaceHostPorts for _ , hp := range hps { if space := spaceInfos . GetByID ( hp . SpaceID ) ; space != nil { logger . Debugf ( " " , hp . Value , space . Name ) selectedHostPorts = append ( selectedHostPorts , hp ) } } if len ( selectedHostPorts ) > 0 { return selectedHostPorts , true } logger . Errorf ( " " , spaceInfos ) return hps , false }
InSpaces returns the SpaceHostPorts that are in the input spaces.
InSpaces returns the SpaceHostPorts that are in the input spaces .