From 44f2def0604a553f5f8b24b3a8d878dde8b74989 Mon Sep 17 00:00:00 2001 From: Verma-Anukul Date: Sun, 20 Jul 2025 23:10:08 -0700 Subject: [PATCH 1/2] Changes required for oc-system xfmr support --- files/build_templates/init_cfg.json.j2 | 5 +++++ .../tests/files/sample_config_db.json | 3 +++ .../tests/yang_model_tests/tests_config/ntp.json | 12 ++++++------ src/sonic-yang-models/yang-models/sonic-ntp.yang | 11 ++++++++--- .../yang-models/sonic-versions.yang | 16 +++++++++++++++- 5 files changed, 37 insertions(+), 10 deletions(-) diff --git a/files/build_templates/init_cfg.json.j2 b/files/build_templates/init_cfg.json.j2 index 1d1c1817b49..8b4f9e63aa6 100644 --- a/files/build_templates/init_cfg.json.j2 +++ b/files/build_templates/init_cfg.json.j2 @@ -212,5 +212,10 @@ "admin_state": "enabled", "vrf": "default" } + }, + "VERSIONS": { + "SOFTWARE": { + "VERSION": "{{build_version}}" + } } } diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 4ad5df98ebc..34d83b3e1cb 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1372,6 +1372,9 @@ "VERSIONS": { "DATABASE": { "VERSION": "version_1_0_3" + }, + "SOFTWARE": { + "VERSION": "sonic_202411_01_03" } }, "TELEMETRY": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/ntp.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/ntp.json index c886bec3d20..7617aad2818 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/ntp.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/ntp.json @@ -28,7 +28,7 @@ ] }, "sonic-ntp:NTP_KEY": { - "NTP_KEYS_LIST": [ + "NTP_KEY_LIST": [ { "id": 10, "value": "bHVtb3M=" @@ -422,7 +422,7 @@ "NTP_KEY_VALID": { "sonic-ntp:sonic-ntp": { "sonic-ntp:NTP_KEY": { - "NTP_KEYS_LIST": [ + "NTP_KEY_LIST": [ { "id": 20, "type": "md5", @@ -448,7 +448,7 @@ "NTP_KEY_ID_INVALID": { "sonic-ntp:sonic-ntp": { "sonic-ntp:NTP_KEY": { - "NTP_KEYS_LIST": [ + "NTP_KEY_LIST": [ { "id": 100000 } @@ -459,7 +459,7 @@ "NTP_KEY_TRUSTED_INVALID": { "sonic-ntp:sonic-ntp": { "sonic-ntp:NTP_KEY": { - "NTP_KEYS_LIST": [ + "NTP_KEY_LIST": [ { "id": 20, "trusted": "nope" @@ -471,7 +471,7 @@ "NTP_KEY_TYPE_INVALID": { "sonic-ntp:sonic-ntp": { "sonic-ntp:NTP_KEY": { - "NTP_KEYS_LIST": [ + "NTP_KEY_LIST": [ { "id": 20, "type": "md6" @@ -483,7 +483,7 @@ "NTP_KEY_VALUE_INVALID": { "sonic-ntp:sonic-ntp": { "sonic-ntp:NTP_KEY": { - "NTP_KEYS_LIST": [ + "NTP_KEY_LIST": [ { "id": 20, "value": "" diff --git a/src/sonic-yang-models/yang-models/sonic-ntp.yang b/src/sonic-yang-models/yang-models/sonic-ntp.yang index 2591f8c7a58..5861ba0b4ca 100644 --- a/src/sonic-yang-models/yang-models/sonic-ntp.yang +++ b/src/sonic-yang-models/yang-models/sonic-ntp.yang @@ -50,6 +50,11 @@ module sonic-ntp { "Add extended configuration options"; } + revision 2025-07-21 { + description + "Corrected NTP_KEY_LIST list name"; + } + typedef association-type { description "NTP server association type"; type enumeration { @@ -192,7 +197,7 @@ module sonic-ntp { leaf key { description "NTP server key ID"; type leafref { - path /ntp:sonic-ntp/ntp:NTP_KEY/ntp:NTP_KEYS_LIST/ntp:id; + path /ntp:sonic-ntp/ntp:NTP_KEY/ntp:NTP_KEY_LIST/ntp:id; } } @@ -234,7 +239,7 @@ module sonic-ntp { description "NTP authentication keys inventory"; - list NTP_KEYS_LIST { + list NTP_KEY_LIST { description "NTP authentication keys inventory"; key "id"; @@ -261,7 +266,7 @@ module sonic-ntp { default md5; description "NTP authentication key type"; } - } /* end of list NTP_KEYS_LIST */ + } /* end of list NTP_KEY_LIST */ } /* end of container NTP_KEY */ diff --git a/src/sonic-yang-models/yang-models/sonic-versions.yang b/src/sonic-yang-models/yang-models/sonic-versions.yang index 9c405e4def2..171394e5da9 100644 --- a/src/sonic-yang-models/yang-models/sonic-versions.yang +++ b/src/sonic-yang-models/yang-models/sonic-versions.yang @@ -8,6 +8,10 @@ module sonic-versions { description "VERSIONS YANG Module for SONiC OS"; + revision 2025-07-21 { + description "Added software version support"; + } + revision 2020-04-10 { description "First Revision"; } @@ -16,7 +20,7 @@ module sonic-versions { container VERSIONS { - description "DATABASE SCHEMA VERSIONS part of config_db.json"; + description "DATABASE SCHEMA & SOFTWARE VERSIONS part of config_db.json"; container DATABASE { @@ -28,6 +32,16 @@ module sonic-versions { } } /* end of container DATABASE */ + + container SOFTWARE { + + leaf VERSION { + type string { + length 1..255; + } + } + } + /* end of container DATABASE */ } /* end of container VERSIONS */ } From 513270ec447322dc59e793ff31e3d130a6d42673 Mon Sep 17 00:00:00 2001 From: Anukul Verma Date: Mon, 22 Sep 2025 11:48:41 +0530 Subject: [PATCH 2/2] Removing software-verison related changes --- files/build_templates/init_cfg.json.j2 | 5 ----- .../tests/files/sample_config_db.json | 3 --- .../yang-models/sonic-versions.yang | 16 +--------------- 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/files/build_templates/init_cfg.json.j2 b/files/build_templates/init_cfg.json.j2 index 8b4f9e63aa6..1d1c1817b49 100644 --- a/files/build_templates/init_cfg.json.j2 +++ b/files/build_templates/init_cfg.json.j2 @@ -212,10 +212,5 @@ "admin_state": "enabled", "vrf": "default" } - }, - "VERSIONS": { - "SOFTWARE": { - "VERSION": "{{build_version}}" - } } } diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 159f2563a56..10d49083037 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1372,9 +1372,6 @@ "VERSIONS": { "DATABASE": { "VERSION": "version_1_0_3" - }, - "SOFTWARE": { - "VERSION": "sonic_202411_01_03" } }, "TELEMETRY": { diff --git a/src/sonic-yang-models/yang-models/sonic-versions.yang b/src/sonic-yang-models/yang-models/sonic-versions.yang index 171394e5da9..9c405e4def2 100644 --- a/src/sonic-yang-models/yang-models/sonic-versions.yang +++ b/src/sonic-yang-models/yang-models/sonic-versions.yang @@ -8,10 +8,6 @@ module sonic-versions { description "VERSIONS YANG Module for SONiC OS"; - revision 2025-07-21 { - description "Added software version support"; - } - revision 2020-04-10 { description "First Revision"; } @@ -20,7 +16,7 @@ module sonic-versions { container VERSIONS { - description "DATABASE SCHEMA & SOFTWARE VERSIONS part of config_db.json"; + description "DATABASE SCHEMA VERSIONS part of config_db.json"; container DATABASE { @@ -32,16 +28,6 @@ module sonic-versions { } } /* end of container DATABASE */ - - container SOFTWARE { - - leaf VERSION { - type string { - length 1..255; - } - } - } - /* end of container DATABASE */ } /* end of container VERSIONS */ }