Repository: sonic-net/sonic-utilities

Issue:
[GCU] Check if BGP_INTERNAL_NEIGHBOR, BGP_MONITORS, BGP_PEER_RANGE, BGP_VOQ_CHASSIS_NEIGHBOR fields are create-only
#### Description
Create-Only fields are only created with their parent, but cannot be modified later.

## Steps to reproduce the issue
1.
2.
3.

#### Describe the results you received


#### Describe the results you expected


#### Additional information you deem important (e.g. issue happens only occasionally)


#### Output of `show version`

```
(paste your output here)
```

<!--
     Also attach debug file produced by `sudo generate_dump`
-->




Discussion:

Resolving patch:
diff --git a/generic_config_updater/patch_sorter.py b/generic_config_updater/patch_sorter.py
--- a/generic_config_updater/patch_sorter.py
+++ b/generic_config_updater/patch_sorter.py
@@ -581,6 +581,14 @@ def __init__(self, path_addressing):
                 ["BGP_NEIGHBOR", "*", "local_addr"],
                 ["BGP_NEIGHBOR", "*", "nhopself"],
                 ["BGP_NEIGHBOR", "*", "rrclient"],
+                ["BGP_PEER_RANGE", "*", "*"],
+                ["BGP_MONITORS", "*", "holdtime"],
+                ["BGP_MONITORS", "*", "keepalive"],
+                ["BGP_MONITORS", "*", "name"],
+                ["BGP_MONITORS", "*", "asn"],
+                ["BGP_MONITORS", "*", "local_addr"],
+                ["BGP_MONITORS", "*", "nhopself"],
+                ["BGP_MONITORS", "*", "rrclient"],
             ],
             path_addressing)
 


Test patch:
diff --git a/tests/generic_config_updater/patch_sorter_test.py b/tests/generic_config_updater/patch_sorter_test.py
--- a/tests/generic_config_updater/patch_sorter_test.py
+++ b/tests/generic_config_updater/patch_sorter_test.py
@@ -1011,6 +1011,28 @@ def test_hard_coded_create_only_paths(self):
                     "nhopself": "0",
                     "rrclient": "0"
                 }
+            },
+            "BGP_PEER_RANGE": {
+                "BGPSLBPassive": {
+                    "ip_range": [
+                        "10.255.0.0/25"
+                    ],
+                    "name": "BGPSLBPassive",
+                    "peer_asn": "65543",
+                    "src_address": "10.1.0.32"
+                }
+            },
+            "BGP_MONITORS": {
+                "5.6.7.8": {
+                    "admin_status": "up",
+                    "asn": "65000",
+                    "holdtime": "180",
+                    "keepalive": "60",
+                    "local_addr": "10.0.0.11",
+                    "name": "BGPMonitor",
+                    "nhopself": "0",
+                    "rrclient": "0"
+                }
             }
         }
         expected = [
@@ -1025,6 +1047,17 @@ def test_hard_coded_create_only_paths(self):
             "/BGP_NEIGHBOR/10.0.0.57/name",
             "/BGP_NEIGHBOR/10.0.0.57/nhopself",
             "/BGP_NEIGHBOR/10.0.0.57/rrclient",
+            "/BGP_PEER_RANGE/BGPSLBPassive/ip_range",
+            "/BGP_PEER_RANGE/BGPSLBPassive/name",
+            "/BGP_PEER_RANGE/BGPSLBPassive/peer_asn",
+            "/BGP_PEER_RANGE/BGPSLBPassive/src_address",
+            "/BGP_MONITORS/5.6.7.8/asn",
+            "/BGP_MONITORS/5.6.7.8/holdtime",
+            "/BGP_MONITORS/5.6.7.8/keepalive",
+            "/BGP_MONITORS/5.6.7.8/local_addr",
+            "/BGP_MONITORS/5.6.7.8/name",
+            "/BGP_MONITORS/5.6.7.8/nhopself",
+            "/BGP_MONITORS/5.6.7.8/rrclient",
         ]
 
         actual = self.validator._get_create_only_paths(config)