X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=E2Manager%2Fhandlers%2Frmrmsghandlers%2Fe2_setup_request_notification_handler.go;h=fd505de04becd34f8144cfd1e01b7cdc9d32c75e;hb=dc8932a553fabccf33b5cbb4e37084362493dbcf;hp=d229e8c9383322d8f92e4a2e80a8778e04d2573e;hpb=197657e0e814c871b903ef779ad654b13347e430;p=ric-plt%2Fe2mgr.git diff --git a/E2Manager/handlers/rmrmsghandlers/e2_setup_request_notification_handler.go b/E2Manager/handlers/rmrmsghandlers/e2_setup_request_notification_handler.go index d229e8c..fd505de 100644 --- a/E2Manager/handlers/rmrmsghandlers/e2_setup_request_notification_handler.go +++ b/E2Manager/handlers/rmrmsghandlers/e2_setup_request_notification_handler.go @@ -137,26 +137,15 @@ func (h *E2SetupRequestNotificationHandler) Handle(request *models.NotificationR func (h *E2SetupRequestNotificationHandler) handleNewRan(ranName string, e2tIpAddress string, setupRequest *models.E2SetupRequestMessage) (*entities.NodebInfo, error) { - nodebInfo, err := h.buildNodebInfo(ranName, e2tIpAddress, setupRequest) + nodebInfo := h.buildNodebInfo(ranName, e2tIpAddress, setupRequest) + err := h.rNibDataService.SaveNodeb(nodebInfo) if err != nil { - h.logger.Errorf("#E2SetupRequestNotificationHandler.handleNewRan - RAN name: %s - failed to build nodebInfo entity. Error: %s", ranName, err) + h.logger.Errorf("#E2SetupRequestNotificationHandler.handleNewRan - RAN name: %s - failed saving nodebInfo. Error: %s", ranName, err) return nil, err } - nbIdentity := h.buildNbIdentity(ranName, setupRequest) - err = h.rNibDataService.SaveNodeb(nbIdentity, nodebInfo) - - if err != nil { - h.logger.Errorf("#E2SetupRequestNotificationHandler.handleNewRan - RAN name: %s - failed to save nodebInfo entity. Error: %s", ranName, err) - return nil, err - } - - err = h.ranConnectStatusChangeManager.ChangeStatus(nodebInfo, entities.ConnectionStatus_CONNECTED) - - if err != nil { - return nil, err - } + _ = h.buildNbIdentity(ranName, setupRequest) // TODO: add call to ranListManager return nodebInfo, nil } @@ -292,9 +281,7 @@ func normalizeXml(payload []byte) []byte { return []byte(normalized) } -func (h *E2SetupRequestNotificationHandler) buildNodebInfo(ranName string, e2tAddress string, request *models.E2SetupRequestMessage) (*entities.NodebInfo, error) { - - var err error +func (h *E2SetupRequestNotificationHandler) buildNodebInfo(ranName string, e2tAddress string, request *models.E2SetupRequestMessage) *entities.NodebInfo { nodebInfo := &entities.NodebInfo{ AssociatedE2TInstanceAddress: e2tAddress, RanName: ranName, @@ -304,7 +291,7 @@ func (h *E2SetupRequestNotificationHandler) buildNodebInfo(ranName string, e2tAd } h.setGnbFunctions(nodebInfo, request) - return nodebInfo, err + return nodebInfo } func (h *E2SetupRequestNotificationHandler) buildGlobalNbId(setupRequest *models.E2SetupRequestMessage) *entities.GlobalNbId {