-func (m E2TShutdownManager) reAssociateRanInMemory(ranName string, ranNamesToBeAssociated map[string][]string, ranNamesToBeDissociated []string) ([]string, error) {
- nodeb, err := m.rnibDataService.GetNodeb(ranName)
- if err != nil {
-
- _, ok := err.(*common.ResourceNotFoundError)
-
- if !ok {
- m.logger.Errorf("#E2TShutdownManager.reAssociateRanInMemory - Failed to get nodeb %s from db.", ranName)
- return ranNamesToBeDissociated, err
- }
-
- m.logger.Errorf("#E2TShutdownManager.reAssociateRanInMemory - nodeb %s not found in db. Skipping it...", ranName)
- return ranNamesToBeDissociated, nil
- }
-
- if nodeb.ConnectionStatus == entities.ConnectionStatus_SHUTTING_DOWN || nodeb.ConnectionStatus == entities.ConnectionStatus_SHUT_DOWN {
- m.logger.Errorf("#E2TShutdownManager.reAssociateRanInMemory - nodeb %s status is %s. Skipping it...", ranName, nodeb.ConnectionStatus)
- return ranNamesToBeDissociated, nil
- }
-
- selectedE2tAddress, err := m.e2TInstancesManager.SelectE2TInstance()
- if err != nil {
- m.logger.Infof("#E2TShutdownManager.reAssociateRanInMemory - No selected E2T instance for nodeb %s found.", ranName)
- ranNamesToBeDissociated = append(ranNamesToBeDissociated, ranName)
- return ranNamesToBeDissociated, nil
- }
-
- ranNamesToBeAssociated[selectedE2tAddress] = append(ranNamesToBeAssociated[selectedE2tAddress], ranName)
- return ranNamesToBeDissociated, nil
-}
-