-
Notifications
You must be signed in to change notification settings - Fork 684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consolidate the get running config way. #3585
Merged
qiluo-msft
merged 13 commits into
sonic-net:master
from
xincunli-sonic:xincun/fix-temp-file-close
Nov 7, 2024
Merged
Consolidate the get running config way. #3585
qiluo-msft
merged 13 commits into
sonic-net:master
from
xincunli-sonic:xincun/fix-temp-file-close
Nov 7, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wen587
previously approved these changes
Oct 25, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
qiluo-msft
reviewed
Nov 5, 2024
config_db_json = json.loads(text) | ||
config_db_json.pop("bgpraw", None) | ||
return config_db_json | ||
return get_config_db_as_json(self.scope) | ||
|
||
def _get_config_db_as_text(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qiluo-msft
approved these changes
Nov 7, 2024
@qiluo-msft Please help cherry-pick this PR to 202405 branch. Thanks |
xincunli-sonic
added a commit
to xincunli-sonic/sonic-utilities
that referenced
this pull request
Nov 26, 2024
#### What I did Addressing the [issue 20508](sonic-net/sonic-buildimage#20508). ADO: 29979987 #### How I did it Remove temp file as intermediate steps. #### How to verify it ``` admin@str2-7250-lc1-2:~$ cat test.json [ { "op": "add", "path": "/asic0/BGP_DEVICE_GLOBAL/STATE/idf_isolation_state", "value": "unisolated" } ] admin@str2-7250-lc1-2:~$ sudo config apply-patch test.json sonic_yang(6):Note: Below table(s) have no YANG models: DHCP_SERVER sonic_yang(6):Note: Below table(s) have no YANG models: LOGGER sonic_yang(6):Note: Below table(s) have no YANG models: LOGGER Patch Applier: asic0: Patch application starting. Patch Applier: asic0: Patch: [{"op": "add", "path": "/BGP_DEVICE_GLOBAL/STATE/idf_isolation_state", "value": "unisolated"}] Patch Applier: asic0 getting current config db. Patch Applier: asic0: simulating the target full config after applying the patch. Patch Applier: asic0: validating all JsonPatch operations are permitted on the specified fields Patch Applier: asic0: validating target config does not have empty tables, since they do not show up in ConfigDb. Patch Applier: asic0: sorting patch updates. Patch Applier: The asic0 patch was converted into 1 change: Patch Applier: asic0: applying 1 change in order: Patch Applier: * [{"op": "replace", "path": "/BGP_DEVICE_GLOBAL/STATE/idf_isolation_state", "value": "unisolated"}] Patch Applier: asic0: verifying patch updates are reflected on ConfigDB. Patch Applier: asic0 patch application completed. Patch applied successfully. admin@str2-7250-lc1-2:~$ show ver SONiC Software Version: SONiC.20220532.72 SONiC OS Version: 11 Distribution: Debian 11.9 Kernel: 5.10.0-23-2-amd64 Build commit: 7766169087 Build date: Fri Oct 4 00:15:40 UTC 2024 Built by: azureuser@98b2318ac000000 Platform: x86_64-nokia_ixr7250e_36x400g-r0 HwSKU: Nokia-IXR7250E-36x100G ASIC: broadcom ASIC Count: 2 Serial Number: NS220304200 Model Number: 3HE12578AARA01 Hardware Revision: 56 Uptime: 05:08:45 up 2 days, 10:16, 1 user, load average: 1.64, 1.82, 1.74 Date: Fri 25 Oct 2024 05:08:45 Docker images: REPOSITORY TAG IMAGE ID SIZE docker-mux 20220532.72 a27de04f0900 375MB docker-mux latest a27de04f0900 375MB docker-macsec latest 9cad4ac054db 372MB docker-sonic-restapi 20220532.72 2dc9b6c42cdb 345MB docker-sonic-restapi latest 2dc9b6c42cdb 345MB docker-orchagent 20220532.72 560867c70e69 360MB docker-orchagent latest 560867c70e69 360MB docker-fpm-frr 20220532.72 525aad3b1670 367MB docker-fpm-frr latest 525aad3b1670 367MB docker-teamd 20220532.72 9bc2875ba21c 343MB docker-teamd latest 9bc2875ba21c 343MB docker-syncd-brcm-dnx 20220532.72 58ee35f9df5b 674MB docker-syncd-brcm-dnx latest 58ee35f9df5b 674MB docker-gbsyncd-credo 20220532.72 5084ec39b3fc 346MB docker-gbsyncd-credo latest 5084ec39b3fc 346MB docker-gbsyncd-broncos 20220532.72 f1011e5ed75c 374MB docker-gbsyncd-broncos latest f1011e5ed75c 374MB docker-dhcp-relay latest 137faf5f4038 337MB docker-platform-monitor 20220532.72 41d6954ab85a 452MB docker-platform-monitor latest 41d6954ab85a 452MB docker-snmp 20220532.72 916f66a40a77 376MB docker-snmp latest 916f66a40a77 376MB docker-sonic-telemetry 20220532.72 e8037e0fd00c 407MB docker-sonic-telemetry latest e8037e0fd00c 407MB docker-router-advertiser 20220532.72 a5afbccec5da 327MB docker-router-advertiser latest a5afbccec5da 327MB docker-lldp 20220532.72 01386dd544cf 369MB docker-lldp latest 01386dd544cf 369MB docker-database 20220532.72 2da62f2abd04 327MB docker-database latest 2da62f2abd04 327MB docker-acms 20220532.72 264a51a7a259 374MB docker-acms latest 264a51a7a259 374MB k8s.gcr.io/pause 3.5 ed210e3e4a5b 683kB ```
mssonicbld
pushed a commit
to mssonicbld/sonic-utilities
that referenced
this pull request
Nov 30, 2024
#### What I did Addressing the [issue 20508](sonic-net/sonic-buildimage#20508). ADO: 29979987 #### How I did it Remove temp file as intermediate steps. #### How to verify it ``` admin@str2-7250-lc1-2:~$ cat test.json [ { "op": "add", "path": "/asic0/BGP_DEVICE_GLOBAL/STATE/idf_isolation_state", "value": "unisolated" } ] admin@str2-7250-lc1-2:~$ sudo config apply-patch test.json sonic_yang(6):Note: Below table(s) have no YANG models: DHCP_SERVER sonic_yang(6):Note: Below table(s) have no YANG models: LOGGER sonic_yang(6):Note: Below table(s) have no YANG models: LOGGER Patch Applier: asic0: Patch application starting. Patch Applier: asic0: Patch: [{"op": "add", "path": "/BGP_DEVICE_GLOBAL/STATE/idf_isolation_state", "value": "unisolated"}] Patch Applier: asic0 getting current config db. Patch Applier: asic0: simulating the target full config after applying the patch. Patch Applier: asic0: validating all JsonPatch operations are permitted on the specified fields Patch Applier: asic0: validating target config does not have empty tables, since they do not show up in ConfigDb. Patch Applier: asic0: sorting patch updates. Patch Applier: The asic0 patch was converted into 1 change: Patch Applier: asic0: applying 1 change in order: Patch Applier: * [{"op": "replace", "path": "/BGP_DEVICE_GLOBAL/STATE/idf_isolation_state", "value": "unisolated"}] Patch Applier: asic0: verifying patch updates are reflected on ConfigDB. Patch Applier: asic0 patch application completed. Patch applied successfully. admin@str2-7250-lc1-2:~$ show ver SONiC Software Version: SONiC.20220532.72 SONiC OS Version: 11 Distribution: Debian 11.9 Kernel: 5.10.0-23-2-amd64 Build commit: 7766169087 Build date: Fri Oct 4 00:15:40 UTC 2024 Built by: azureuser@98b2318ac000000 Platform: x86_64-nokia_ixr7250e_36x400g-r0 HwSKU: Nokia-IXR7250E-36x100G ASIC: broadcom ASIC Count: 2 Serial Number: NS220304200 Model Number: 3HE12578AARA01 Hardware Revision: 56 Uptime: 05:08:45 up 2 days, 10:16, 1 user, load average: 1.64, 1.82, 1.74 Date: Fri 25 Oct 2024 05:08:45 Docker images: REPOSITORY TAG IMAGE ID SIZE docker-mux 20220532.72 a27de04f0900 375MB docker-mux latest a27de04f0900 375MB docker-macsec latest 9cad4ac054db 372MB docker-sonic-restapi 20220532.72 2dc9b6c42cdb 345MB docker-sonic-restapi latest 2dc9b6c42cdb 345MB docker-orchagent 20220532.72 560867c70e69 360MB docker-orchagent latest 560867c70e69 360MB docker-fpm-frr 20220532.72 525aad3b1670 367MB docker-fpm-frr latest 525aad3b1670 367MB docker-teamd 20220532.72 9bc2875ba21c 343MB docker-teamd latest 9bc2875ba21c 343MB docker-syncd-brcm-dnx 20220532.72 58ee35f9df5b 674MB docker-syncd-brcm-dnx latest 58ee35f9df5b 674MB docker-gbsyncd-credo 20220532.72 5084ec39b3fc 346MB docker-gbsyncd-credo latest 5084ec39b3fc 346MB docker-gbsyncd-broncos 20220532.72 f1011e5ed75c 374MB docker-gbsyncd-broncos latest f1011e5ed75c 374MB docker-dhcp-relay latest 137faf5f4038 337MB docker-platform-monitor 20220532.72 41d6954ab85a 452MB docker-platform-monitor latest 41d6954ab85a 452MB docker-snmp 20220532.72 916f66a40a77 376MB docker-snmp latest 916f66a40a77 376MB docker-sonic-telemetry 20220532.72 e8037e0fd00c 407MB docker-sonic-telemetry latest e8037e0fd00c 407MB docker-router-advertiser 20220532.72 a5afbccec5da 327MB docker-router-advertiser latest a5afbccec5da 327MB docker-lldp 20220532.72 01386dd544cf 369MB docker-lldp latest 01386dd544cf 369MB docker-database 20220532.72 2da62f2abd04 327MB docker-database latest 2da62f2abd04 327MB docker-acms 20220532.72 264a51a7a259 374MB docker-acms latest 264a51a7a259 374MB k8s.gcr.io/pause 3.5 ed210e3e4a5b 683kB ```
Cherry-pick PR to 202405: #3633 |
mssonicbld
pushed a commit
that referenced
this pull request
Nov 30, 2024
#### What I did Addressing the [issue 20508](sonic-net/sonic-buildimage#20508). ADO: 29979987 #### How I did it Remove temp file as intermediate steps. #### How to verify it ``` admin@str2-7250-lc1-2:~$ cat test.json [ { "op": "add", "path": "/asic0/BGP_DEVICE_GLOBAL/STATE/idf_isolation_state", "value": "unisolated" } ] admin@str2-7250-lc1-2:~$ sudo config apply-patch test.json sonic_yang(6):Note: Below table(s) have no YANG models: DHCP_SERVER sonic_yang(6):Note: Below table(s) have no YANG models: LOGGER sonic_yang(6):Note: Below table(s) have no YANG models: LOGGER Patch Applier: asic0: Patch application starting. Patch Applier: asic0: Patch: [{"op": "add", "path": "/BGP_DEVICE_GLOBAL/STATE/idf_isolation_state", "value": "unisolated"}] Patch Applier: asic0 getting current config db. Patch Applier: asic0: simulating the target full config after applying the patch. Patch Applier: asic0: validating all JsonPatch operations are permitted on the specified fields Patch Applier: asic0: validating target config does not have empty tables, since they do not show up in ConfigDb. Patch Applier: asic0: sorting patch updates. Patch Applier: The asic0 patch was converted into 1 change: Patch Applier: asic0: applying 1 change in order: Patch Applier: * [{"op": "replace", "path": "/BGP_DEVICE_GLOBAL/STATE/idf_isolation_state", "value": "unisolated"}] Patch Applier: asic0: verifying patch updates are reflected on ConfigDB. Patch Applier: asic0 patch application completed. Patch applied successfully. admin@str2-7250-lc1-2:~$ show ver SONiC Software Version: SONiC.20220532.72 SONiC OS Version: 11 Distribution: Debian 11.9 Kernel: 5.10.0-23-2-amd64 Build commit: 7766169087 Build date: Fri Oct 4 00:15:40 UTC 2024 Built by: azureuser@98b2318ac000000 Platform: x86_64-nokia_ixr7250e_36x400g-r0 HwSKU: Nokia-IXR7250E-36x100G ASIC: broadcom ASIC Count: 2 Serial Number: NS220304200 Model Number: 3HE12578AARA01 Hardware Revision: 56 Uptime: 05:08:45 up 2 days, 10:16, 1 user, load average: 1.64, 1.82, 1.74 Date: Fri 25 Oct 2024 05:08:45 Docker images: REPOSITORY TAG IMAGE ID SIZE docker-mux 20220532.72 a27de04f0900 375MB docker-mux latest a27de04f0900 375MB docker-macsec latest 9cad4ac054db 372MB docker-sonic-restapi 20220532.72 2dc9b6c42cdb 345MB docker-sonic-restapi latest 2dc9b6c42cdb 345MB docker-orchagent 20220532.72 560867c70e69 360MB docker-orchagent latest 560867c70e69 360MB docker-fpm-frr 20220532.72 525aad3b1670 367MB docker-fpm-frr latest 525aad3b1670 367MB docker-teamd 20220532.72 9bc2875ba21c 343MB docker-teamd latest 9bc2875ba21c 343MB docker-syncd-brcm-dnx 20220532.72 58ee35f9df5b 674MB docker-syncd-brcm-dnx latest 58ee35f9df5b 674MB docker-gbsyncd-credo 20220532.72 5084ec39b3fc 346MB docker-gbsyncd-credo latest 5084ec39b3fc 346MB docker-gbsyncd-broncos 20220532.72 f1011e5ed75c 374MB docker-gbsyncd-broncos latest f1011e5ed75c 374MB docker-dhcp-relay latest 137faf5f4038 337MB docker-platform-monitor 20220532.72 41d6954ab85a 452MB docker-platform-monitor latest 41d6954ab85a 452MB docker-snmp 20220532.72 916f66a40a77 376MB docker-snmp latest 916f66a40a77 376MB docker-sonic-telemetry 20220532.72 e8037e0fd00c 407MB docker-sonic-telemetry latest e8037e0fd00c 407MB docker-router-advertiser 20220532.72 a5afbccec5da 327MB docker-router-advertiser latest a5afbccec5da 327MB docker-lldp 20220532.72 01386dd544cf 369MB docker-lldp latest 01386dd544cf 369MB docker-database 20220532.72 2da62f2abd04 327MB docker-database latest 2da62f2abd04 327MB docker-acms 20220532.72 264a51a7a259 374MB docker-acms latest 264a51a7a259 374MB k8s.gcr.io/pause 3.5 ed210e3e4a5b 683kB ```
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What I did
Addressing the issue 20508.
ADO: 29979987
How I did it
Remove temp file as intermediate steps.
How to verify it
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)