fixed issue in meid table if same meid is associated with different E2T 61/9261/2
authorAbdulwahid W <abdulwahid.w@nokia.com>
Thu, 13 Oct 2022 14:50:20 +0000 (14:50 +0000)
committerAbdulwahid W <abdulwahid.w@nokia.com>
Fri, 14 Oct 2022 14:16:52 +0000 (14:16 +0000)
Signed-off-by: Abdulwahid W <abdulwahid.w@nokia.com>
Change-Id: Ie8c4cdbd0a67bfd77fdd40c0d2cfccea8e788aaf

RELNOTES
container-tag.yaml
pkg/rpe/rmr.go
pkg/rpe/types.go

index d68b57f..15d9ecf 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -1,3 +1,6 @@
+### v0.9.2
+* fixed issue in meid table if same meid is associated with different E2T 
+
 ### v0.8.2
 * Added some checks for E2tcreate handling and RMR update to v4.8.0 
 
index 2479949..7898fd5 100644 (file)
@@ -2,4 +2,4 @@
 # By default this file is in the docker build directory,
 # but the location can configured in the JJB template.
 ---
-tag: 0.9.1
+tag: 0.9.2
index 5447693..87c0e2b 100644 (file)
@@ -96,32 +96,34 @@ func (r *Rmr) generateRMRPolicies(eps rtmgr.Endpoints, rcs *rtmgr.RicComponents,
        count := 0
 
        rawrt = append(rawrt, key+"meid_map|start\n")
-       keys := make(map[string]RouteIndex)
+       
+       keys := make(map[string]MeidEntry)
+       MEID := ""
+       E2TIP := ""
+       RECTYP := ""
        for _, value := range rcs.MeidMap {
-               if _, v := keys[key+value+"\n"]; !v {
-                       rawrt = append(rawrt, key+value+"\n")
-                       appendedindex := uint16(len(rawrt) - 1)
-                       keys[key+value+"\n"] = RouteIndex{true, appendedindex}
-                       count++
-               }
                if strings.Contains(value, "mme_ar") {
                        tmpstr := strings.Split(value, "|")
-
                        //MEID entry for mme_ar must always contain 3 strings speartred by | i.e "mme_ar|<string1>|<string2>"
-                       MEID := strings.TrimSuffix(tmpstr[2], "\n")
-
-                       mapindex := "mme_del|" + MEID + "\n"
-                       i := keys[mapindex].index
-                       if keys[mapindex].flag {
-                               //copy(rawrt[i:], rawrt[i+1:])
-                               //rawrt[len(rawrt)-1] = ""
-                               //rawrt = rawrt[:len(rawrt)-1]
-                               rawrt[i] = ""
-                               delete(keys, mapindex)
-                               count--
-                       }
+                       MEID = strings.TrimSuffix(tmpstr[2], "\n")
+                       E2TIP = strings.TrimSuffix(tmpstr[1], "\n")
+                       RECTYP = "mme_ar"
+               } else if strings.Contains(value, "mme_del") {
+                       tmpstr := strings.Split(value, "|")
+                       MEID = strings.TrimSuffix(tmpstr[1], "\n")
+                       E2TIP = ""
+                       RECTYP = "mme_del"
                }
+               keys[MEID] = MeidEntry{RECTYP, E2TIP}
        }
+
+       for k, v := range keys {
+               if v.recordtype == "mme_ar" {
+                       rawrt = append(rawrt, key+v.recordtype+"|"+v.e2tip+"|"+k+"\n")
+                   count++
+               }
+       }
+
        rawrt = removeEmptyStrings(rawrt)
        rawrt = append(rawrt, key+"meid_map|end|"+strconv.Itoa(count)+"\n")
 
index 95cdf01..b7e1742 100644 (file)
@@ -51,7 +51,7 @@ type Engine interface {
        GeneratePartialPolicies(eps rtmgr.Endpoints, xappSubData *models.XappSubscriptionData, updatetype rtmgr.RMRUpdateType) *[]string
 }
 
-type RouteIndex struct {
-       flag  bool
-       index uint16
+type MeidEntry struct {
+       recordtype string
+       e2tip      string
 }