Skip to content

Commit

Permalink
pbrd: fix map seq installed flag in json
Browse files Browse the repository at this point in the history
Ticket:#3638598
Testing:

Post fix:
tor-2# show pbr map json
[
  {
    "name":"global-vrf-PBR-map",
    "valid":true,
    "policies":[
      {
        "id":1,
        "sequenceNumber":10,
        "ruleNumber":309,
        "vrfUnchanged":false,
        "installed":true,   <<<< now display correct value
        "installedReason":"Valid",
        "vrfName":"sym_1",
        "matchSrc":"10.1.200.0\/24",
        "matchDst":"10.6.200.0\/24"
      }
    ]
  }

Signed-off-by: Chirag Shah <[email protected]>
  • Loading branch information
chiragshah6 committed Dec 5, 2023
1 parent 03e3b34 commit 64745d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions pbrd/pbr_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -1667,8 +1667,7 @@ static void vty_json_pbrms(json_object *j, struct vty *vty,
json_object_int_add(jpbrm, "sequenceNumber", pbrms->seqno);
json_object_int_add(jpbrm, "ruleNumber", pbrms->ruleno);
json_object_boolean_add(jpbrm, "vrfUnchanged", pbrms->vrf_unchanged);
json_object_boolean_add(jpbrm, "installed",
pbr_nht_get_installed(nhg_name));
json_object_boolean_add(jpbrm, "installed", pbrms->installed);
json_object_string_add(jpbrm, "installedReason",
pbrms->reason ? rbuf : "Valid");

Expand Down
6 changes: 3 additions & 3 deletions tests/topotests/pbr_topo1/r1/pbr-map.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{
"sequenceNumber":10,
"vrfUnchanged":false,
"installed":true,
"installed":false,
"installedReason":"Invalid Src or Dst",
"nexthopGroup":{
"name":"C",
Expand Down Expand Up @@ -98,7 +98,7 @@
{
"sequenceNumber":5,
"vrfUnchanged":false,
"installed":false,
"installed":true,
"installedReason":"Invalid NH-group",
"nexthopGroup":{
"name":"B",
Expand All @@ -111,7 +111,7 @@
{
"sequenceNumber":10,
"vrfUnchanged":true,
"installed":false,
"installed":true,
"installedReason":"Valid",
"matchSrc":"1.2.0.0\/16",
"matchDst":"3.4.5.0\/24"
Expand Down

0 comments on commit 64745d4

Please sign in to comment.