[RICPLT-2527] Fix according to acceptance comments
[ric-plt/e2mgr.git] / E2Manager / managers / ran_reconnection_manager.go
index 530131f..b733142 100644 (file)
@@ -94,14 +94,10 @@ func (m *RanReconnectionManager) canReconnectRan(nodebInfo *entities.NodebInfo)
                int(nodebInfo.GetConnectionAttempts()) < m.config.MaxConnectionAttempts
 }
 
-func (m *RanReconnectionManager) updateNodebInfo(nodebInfo *entities.NodebInfo, connectionStatus entities.ConnectionStatus, resetE2tAddress bool) error {
+func (m *RanReconnectionManager) updateNodebInfo(nodebInfo *entities.NodebInfo, connectionStatus entities.ConnectionStatus) error {
 
        nodebInfo.ConnectionStatus = connectionStatus;
 
-       if resetE2tAddress {
-               nodebInfo.AssociatedE2TInstanceAddress = ""
-       }
-
        err := m.rnibDataService.UpdateNodebInfo(nodebInfo)
 
        if err != nil {
@@ -123,12 +119,12 @@ func (m *RanReconnectionManager) updateUnconnectableRan(nodebInfo *entities.Node
 
        if connectionStatus == entities.ConnectionStatus_SHUTTING_DOWN {
                m.logger.Warnf("#RanReconnectionManager.updateUnconnectableRan - RAN name: %s - Cannot reconnect RAN. Reason: connection status is SHUTTING_DOWN", nodebInfo.RanName)
-               return m.updateNodebInfo(nodebInfo, entities.ConnectionStatus_SHUT_DOWN, false)
+               return m.updateNodebInfo(nodebInfo, entities.ConnectionStatus_SHUT_DOWN)
        }
 
        if m.isRanExceededConnectionAttempts(nodebInfo) {
                m.logger.Warnf("#RanReconnectionManager.updateUnconnectableRan - RAN name: %s - Cannot reconnect RAN. Reason: RAN's connection attempts exceeded the limit (%d)", nodebInfo.RanName, m.config.MaxConnectionAttempts)
-               return m.updateNodebInfo(nodebInfo, entities.ConnectionStatus_DISCONNECTED, true)
+               return m.updateNodebInfo(nodebInfo, entities.ConnectionStatus_DISCONNECTED)
        }
 
        return nil