Skip to content

Commit c1752df

Browse files
authored
Merge branch 'master' into oc-intf-upgrade_new-leaves-support_bug-fixes
2 parents 6d77af3 + f98b3c7 commit c1752df

19 files changed

+1990
-553
lines changed

models/yang/annotations/sonic-extensions.yang

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,10 @@ module sonic-extensions {
7575
description "Transformer name that will perform post-translation tasks.";
7676
}
7777

78-
extension get-validate {
79-
argument "get-validate-name";
80-
description "Validation callpoint used to validate a YANG node during data translation back to YANG as a response to GET.";
78+
extension validate-xfmr {
79+
argument "validate-xfmr-name";
80+
description "Validation callpoint used to validate a YANG node during data translation.
81+
Equivalent to XPath evaluation on when statement";
8182
}
8283

8384
extension db-name {
@@ -107,7 +108,9 @@ module sonic-extensions {
107108

108109
extension table-owner {
109110
argument "table-owner-flag";
110-
description "Owner of the redis-db table.";
111+
description "Indicates table ownership of the redis-db table annotated at the node.
112+
The extension is applicable to the nodes annotated with table-name or table-transformer and having no subtree-transformer annotation.
113+
The table-owner is deemed to be true unless it is annotated with its value to 'false'.";
111114
}
112115

113116
extension virtual-table {

translib/common_app.go

Lines changed: 259 additions & 53 deletions
Large diffs are not rendered by default.

translib/db/db.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,10 @@ func (d *DB) IsDirtified() bool {
333333
return (len(d.txCmds) > 0)
334334
}
335335

336+
func GetDBInstName(dbNo DBNum) string {
337+
return getDBInstName(dbNo)
338+
}
339+
336340
func getDBInstName(dbNo DBNum) string {
337341
switch dbNo {
338342
case ApplDB:

translib/db/db_config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,7 @@ func getDbPassword(dbName string) string {
159159
}
160160
return password
161161
}
162+
163+
func GetDbConfigMap() map[string]interface{} {
164+
return dbConfigMap
165+
}

translib/transformer/test/openconfig-test-xfmr-annot.yang

Lines changed: 112 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ module openconfig-test-xfmr-annot {
8181
deviation /oc-test-xfmr:test-xfmr/oc-test-xfmr:test-sensor-groups/oc-test-xfmr:test-sensor-group/oc-test-xfmr:test-sensor-types/oc-test-xfmr:test-sensor-type/oc-test-xfmr:sensor-a-light-sensors {
8282
deviate add {
8383
sonic-ext:table-name "NONE";
84-
sonic-ext:get-validate "light_sensor_validate";
84+
sonic-ext:validate-xfmr "light_sensor_validate";
8585
}
8686
}
8787

@@ -111,6 +111,21 @@ module openconfig-test-xfmr-annot {
111111
}
112112
}
113113

114+
deviation /oc-test-xfmr:test-xfmr/oc-test-xfmr:test-sets/oc-test-xfmr:system-zone-device-data {
115+
deviate add {
116+
sonic-ext:table-name "DEVICE_ZONE_METADATA";
117+
sonic-ext:key-name "local-zonehost";
118+
sonic-ext:table-owner "false";
119+
}
120+
}
121+
122+
deviation /oc-test-xfmr:test-xfmr/oc-test-xfmr:test-sets/oc-test-xfmr:transport-zone {
123+
deviate add {
124+
sonic-ext:table-name "TRANSPORT_ZONE";
125+
sonic-ext:key-name "transport-host";
126+
}
127+
}
128+
114129
deviation /oc-test-xfmr:test-xfmr/oc-test-xfmr:test-sets/oc-test-xfmr:test-set {
115130
deviate add {
116131
sonic-ext:table-name "TEST_SET_TABLE";
@@ -168,5 +183,100 @@ module openconfig-test-xfmr-annot {
168183
sonic-ext:key-name "global_sensor";
169184
}
170185
}
171-
}
172186

187+
deviation /oc-test-xfmr:test-xfmr/oc-test-xfmr:test-ntp {
188+
deviate add {
189+
sonic-ext:table-name "TEST_NTP";
190+
sonic-ext:key-name "global";
191+
}
192+
}
193+
194+
deviation /oc-test-xfmr:test-xfmr/oc-test-xfmr:test-ntp/oc-test-xfmr:config/oc-test-xfmr:enable-ntp-auth {
195+
deviate add {
196+
sonic-ext:field-name "auth-enabled";
197+
}
198+
}
199+
200+
deviation /oc-test-xfmr:test-xfmr/oc-test-xfmr:test-ntp/oc-test-xfmr:test-ntp-keys {
201+
deviate add {
202+
sonic-ext:table-name "NONE";
203+
}
204+
}
205+
206+
deviation /oc-test-xfmr:test-xfmr/oc-test-xfmr:test-ntp/oc-test-xfmr:test-ntp-keys/oc-test-xfmr:test-ntp-key {
207+
deviate add {
208+
sonic-ext:table-name "TEST_NTP_AUTHENTICATION_KEY";
209+
}
210+
}
211+
212+
deviation /oc-test-xfmr:test-xfmr/oc-test-xfmr:test-ntp/oc-test-xfmr:test-ntp-keys/oc-test-xfmr:test-ntp-key/oc-test-xfmr:key-type {
213+
deviate add {
214+
sonic-ext:field-transformer "test_ntp_auth_key_type_xfmr";
215+
}
216+
}
217+
218+
deviation /oc-test-xfmr:test-xfmr/oc-test-xfmr:test-ntp/oc-test-xfmr:test-ntp-servers/oc-test-xfmr:test-ntp-server {
219+
deviate add {
220+
sonic-ext:table-name "TEST_NTP_SERVER";
221+
}
222+
}
223+
224+
deviation /oc-test-xfmr:test-xfmr/oc-test-xfmr:test-ni-instances/oc-test-xfmr:test-ni-instance {
225+
deviate add {
226+
sonic-ext:table-name "TEST_VRF";
227+
sonic-ext:key-transformer "test_ni_instance_key_xfmr";
228+
}
229+
}
230+
231+
deviation /oc-test-xfmr:test-xfmr/oc-test-xfmr:test-ni-instances/oc-test-xfmr:test-ni-instance/oc-test-xfmr:test-protocols {
232+
deviate add {
233+
sonic-ext:table-name "NONE";
234+
}
235+
}
236+
237+
deviation /oc-test-xfmr:test-xfmr/oc-test-xfmr:test-ni-instances/oc-test-xfmr:test-ni-instance/oc-test-xfmr:test-protocols/oc-test-xfmr:test-protocol {
238+
deviate add {
239+
sonic-ext:table-transformer "test_ni_instance_protocol_table_xfmr";
240+
sonic-ext:key-transformer "test_ni_instance_protocol_key_xfmr";
241+
}
242+
}
243+
244+
deviation /oc-test-xfmr:test-xfmr/oc-test-xfmr:test-ni-instances/oc-test-xfmr:test-ni-instance/oc-test-xfmr:test-protocols/oc-test-xfmr:test-protocol/oc-test-xfmr:bgp {
245+
deviate add {
246+
sonic-ext:validate-xfmr "validate_bgp_proto";
247+
}
248+
}
249+
250+
deviation /oc-test-xfmr:test-xfmr/oc-test-xfmr:test-ni-instances/oc-test-xfmr:test-ni-instance/oc-test-xfmr:test-protocols/oc-test-xfmr:test-protocol/oc-test-xfmr:bgp/oc-test-xfmr:network-cfgs/oc-test-xfmr:network-cfg {
251+
deviate add {
252+
sonic-ext:table-name "TEST_BGP_NETWORK_CFG";
253+
sonic-ext:key-transformer "test_bgp_network_cfg_key_xfmr";
254+
}
255+
}
256+
257+
deviation /oc-test-xfmr:test-xfmr/oc-test-xfmr:test-ni-instances/oc-test-xfmr:test-ni-instance/oc-test-xfmr:test-protocols/oc-test-xfmr:test-protocol/oc-test-xfmr:ospfv2 {
258+
deviate add {
259+
sonic-ext:validate-xfmr "validate_ospfv2_proto";
260+
}
261+
}
262+
263+
deviation /oc-test-xfmr:test-xfmr/oc-test-xfmr:test-ni-instances/oc-test-xfmr:test-ni-instance/oc-test-xfmr:test-protocols/oc-test-xfmr:test-protocol/oc-test-xfmr:ospfv2/oc-test:global {
264+
deviate add {
265+
sonic-ext:table-name "TEST_OSPFV2_ROUTER";
266+
sonic-ext:key-transformer "test_ospfv2_router_key_xfmr";
267+
}
268+
}
269+
270+
deviation /oc-test-xfmr:test-xfmr/oc-test-xfmr:test-ni-instances/oc-test-xfmr:test-ni-instance/oc-test-xfmr:test-protocols/oc-test-xfmr:test-protocol/oc-test-xfmr:ospfv2/oc-test:global/oc-test-xfmr:route-distribution-lists {
271+
deviate add {
272+
sonic-ext:table-name "NONE";
273+
}
274+
}
275+
276+
deviation /oc-test-xfmr:test-xfmr/oc-test-xfmr:test-ni-instances/oc-test-xfmr:test-ni-instance/oc-test-xfmr:test-protocols/oc-test-xfmr:test-protocol/oc-test-xfmr:ospfv2/oc-test:global/oc-test-xfmr:route-distribution-lists/oc-test-xfmr:route-distribution-list {
277+
deviate add {
278+
sonic-ext:table-name "TEST_OSPFV2_ROUTER_DISTRIBUTION";
279+
sonic-ext:key-transformer "test_ospfv2_router_distribution_key_xfmr";
280+
}
281+
}
282+
}

0 commit comments

Comments
 (0)