"e2mgr/clients"
"e2mgr/logger"
"e2mgr/services"
+ "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
)
type E2TAssociationManager struct {
}
}
-func (m *E2TAssociationManager) AssociateRan(e2tAddress string, ranName string) error {
+func (m *E2TAssociationManager) AssociateRan(e2tAddress string, nodebInfo *entities.NodebInfo) error {
+ ranName := nodebInfo.RanName
m.logger.Infof("#E2TAssociationManager.AssociateRan - Associating RAN %s to E2T Instance address: %s", ranName, e2tAddress)
err := m.rmClient.AssociateRanToE2TInstance(e2tAddress, ranName)
return err
}
- nodebInfo, rnibErr := m.rnibDataService.GetNodeb(ranName)
-
- if rnibErr != nil {
- m.logger.Errorf("#E2TAssociationManager.AssociateRan - RAN name: %s - Failed fetching RAN from rNib. Error: %s", ranName, rnibErr)
- return rnibErr
- }
-
nodebInfo.AssociatedE2TInstanceAddress = e2tAddress
nodebInfo.ConnectionAttempts = 0
- rnibErr = m.rnibDataService.UpdateNodebInfo(nodebInfo)
+ rnibErr := m.rnibDataService.UpdateNodebInfo(nodebInfo)
if rnibErr != nil {
m.logger.Errorf("#E2TAssociationManager.AssociateRan - RAN name: %s - Failed to update RAN.AssociatedE2TInstanceAddress in rNib. Error: %s", ranName, rnibErr)
return rnibErr