func migrateLocalModelUsers(usermodels map[string]*ControllerModels) error {
	changes := false
	for _, modelDetails := range usermodels {
		for name, model := range modelDetails.Models {
			migratedName, changed, err := migrateModelName(name)
			if err != nil {
				return errors.Trace(err)
			}
			if !changed {
				continue
			}
			delete(modelDetails.Models, name)
			modelDetails.Models[migratedName] = model
			changes = true
		}
		migratedName, changed, err := migrateModelName(modelDetails.CurrentModel)
		if err != nil {
			return errors.Trace(err)
		}
		if !changed {
			continue
		}
		modelDetails.CurrentModel = migratedName
	}
	if changes {
		return WriteModelsFile(usermodels)
	}
	return nil
}
// migrateLocalModelUsers strips any @local domains from any qualified model names.
migrateLocalModelUsers strips any @local domains from any qualified model names.
// migrateLocalModelUsers strips any @local domains from any qualified model names .
func migrateLocalModelUsers(usermodels map[string]*ControllerModels) error {
	changes := false
	for _, modelDetails := range usermodels {
		for name, model := range modelDetails.Models {
			migratedName, changed, err := migrateModelName(name)
			if err != nil {
				return errors.Trace(err)
			}
			if !changed {
				continue
			}
			delete(modelDetails.Models, name)
			modelDetails.Models[migratedName] = model
			changes = true
		}
		migratedName, changed, err := migrateModelName(modelDetails.CurrentModel)
		if err != nil {
			return errors.Trace(err)
		}
		if !changed {
			continue
		}
		modelDetails.CurrentModel = migratedName
	}
	if changes {
		return WriteModelsFile(usermodels)
	}
	return nil
}
func migrateLocalModelUsers ( usermodels map [ string ] * ControllerModels ) error { changes := false for _ , modelDetails := range usermodels { for name , model := range modelDetails . Models { migratedName , changed , err := migrateModelName ( name ) if err != nil { return errors . Trace ( err ) } if ! changed { continue } delete ( modelDetails . Models , name ) modelDetails . Models [ migratedName ] = model changes = true } migratedName , changed , err := migrateModelName ( modelDetails . CurrentModel ) if err != nil { return errors . Trace ( err ) } if ! changed { continue } modelDetails . CurrentModel = migratedName } if changes { return WriteModelsFile ( usermodels ) } return nil }
migrateLocalModelUsers strips any @local domains from any qualified model names.
migrateLocalModelUsers strips any @local domains from any qualified model names .