X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=E2Manager%2Fhandlers%2Frmrmsghandlers%2Fe2_setup_request_notification_handler.go;fp=E2Manager%2Fhandlers%2Frmrmsghandlers%2Fe2_setup_request_notification_handler.go;h=fd505de04becd34f8144cfd1e01b7cdc9d32c75e;hb=dc8932a553fabccf33b5cbb4e37084362493dbcf;hp=0b8ce33effba186cbded54ff0f9ba4349f6c61bc;hpb=16b10a5fcf938a92471f1c7f24ad12084be8bb53;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 0b8ce33..fd505de 100644 --- a/E2Manager/handlers/rmrmsghandlers/e2_setup_request_notification_handler.go +++ b/E2Manager/handlers/rmrmsghandlers/e2_setup_request_notification_handler.go @@ -137,20 +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 - } + _ = h.buildNbIdentity(ranName, setupRequest) // TODO: add call to ranListManager return nodebInfo, nil } @@ -286,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, @@ -298,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 {