Skip to content

Commit ab4c548

Browse files
authored
Vnet_name added in create_only patterns (#3878)
What I did Added support to mark the vnet_name field as a create-only field in VLAN_INTERFACE, VLAN_SUB_INTERFACE, and INTERFACE tables. How I did it Updated patch_sorter.py to include the following patterns as create-only fields: ["VLAN_SUB_INTERFACE", "*", "vnet_name"], ["VLAN_INTERFACE", "*", "vnet_name"], ["INTERFACE", "*", "vnet_name"] Added test data in patch_sorter_test.py to verify these fields are identified as create-only. Updated change_applier_test.data.json with example entries containing vnet_name fields. Added unit tests in patch_sorter_test_success.json for test_patch_sorter_success in patch_sorter_test.py
1 parent 04a2005 commit ab4c548

File tree

4 files changed

+384
-1
lines changed

4 files changed

+384
-1
lines changed

generic_config_updater/patch_sorter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,9 @@ def __init__(self, path_addressing):
571571
["BGP_MONITORS", "*", "nhopself"],
572572
["BGP_MONITORS", "*", "rrclient"],
573573
["MIRROR_SESSION", "*", "*"],
574+
["VLAN_SUB_INTERFACE", "*", "vnet_name"],
575+
["VLAN_INTERFACE", "*", "vnet_name"],
576+
["INTERFACE", "*", "vnet_name"],
574577
]
575578

576579
def get_filter(self):

tests/generic_config_updater/files/change_applier_test.data.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@
136136
"type": "LeafRouter"
137137
}
138138
},
139+
"INTERFACE": {
140+
"Ethernet2": {
141+
"vnet_name": "Vnet3"
142+
}
143+
},
139144
"PORT": {
140145
"Ethernet0": {
141146
"alias": "fortyGigE0/0",
@@ -232,7 +237,10 @@
232237
"VLAN_INTERFACE": {
233238
"Vlan1000": {},
234239
"Vlan1000|192.168.0.1/21": {},
235-
"Vlan1000|2603:10b0:b13:c70::1/64": {}
240+
"Vlan1000|2603:10b0:b13:c70::1/64": {},
241+
"Vlan100": {
242+
"vnet_name": "Vnet2"
243+
}
236244
},
237245
"VLAN_MEMBER": {
238246
"Vlan1000|Ethernet12": {
@@ -244,6 +252,12 @@
244252
"Vlan1000|Ethernet28": {
245253
}
246254
},
255+
"VLAN_SUB_INTERFACE": {
256+
"Ethernet0.10": {
257+
"vlan": 10,
258+
"vnet_name": "Vnet1"
259+
}
260+
},
247261
"WRED_PROFILE": {
248262
"AZURE_LOSSLESS": {
249263
"ecn": "ecn_all",

0 commit comments

Comments
 (0)