Skip to content

Commit

Permalink
fix(evpn): frr bug pr review fix of frrbgpcmd output
Browse files Browse the repository at this point in the history
Signed-off-by: Vemula Venkatesh <venkatesh.vemula@intel.com>
  • Loading branch information
venkyvsp committed Dec 19, 2024
1 parent 7f933f8 commit 3a8b09f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/frr/frr.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,14 +513,12 @@ func setUpVrf(vrf *infradb.Vrf) (string, bool) {
l2VpnCmd := strings.Split(cp, "json")
l2VpnCmd = strings.Split(l2VpnCmd[1], hname)
cp = l2VpnCmd[0]
if regexp.MustCompile(`^[a-zA-Z0-9]*$`).MatchString(cp) {
cp = cp[3 : len(cp)-3]
} else {
if regexp.MustCompile(`({}){1}`).MatchString(cp) {
log.Printf("FRR: unable to get the command %s\n", cmd)
return fmt.Sprintf("FRR: unable to get the command %s\n", cmd), false
}
var bgpL2vpn bgpl2VpnCmd
err1 := json.Unmarshal([]byte(fmt.Sprintf("{%v}", cp)), &bgpL2vpn)
err1 := json.Unmarshal([]byte(cp), &bgpL2vpn)
if err1 != nil {
log.Printf("error-%v", err)
}
Expand Down

0 comments on commit 3a8b09f

Please sign in to comment.