Commit 4c7e54a
authored
[qos reload] Fix "config qos reload" overriding entire CONFIG_DB (#3479)
Fixes #15894
- What I did
config qos reload command uses a combination of sonic-cfggen's flags -d and --write-to-db that makes it override entire CONFIG_DB, updating every key. This leads to issues with Orchs, daemons that do not support updating keys in CONFIG_DB. Best case, it causes errors in logs.
- How I did it
First, render templates to temporary files, then load those files into CONFIG_DB.
Also, fixed an issue where using dry_run option only produced QOS config but not the buffer configuration and updated test files accordingly.
- How to verify it
Run on switch:
root@sonic/home/admin# config qos reload
Running command: /usr/local/bin/sonic-cfggen -d -t /usr/share/sonic/device/x86_64-mlnx_msn2100-r0/ACS-MSN2100/buffers_dynamic.json.j2,/tmp/cfg_buffer.json -t /usr/share/sonic/device/x86_64-mlnx_msn2100-r0/ACS-MSN2100/qos.json.j2,/tmp/cfg_qos.json -y /etc/sonic/sonic_version.yml
Running command: /usr/local/bin/sonic-cfggen -j /tmp/cfg_buffer.json -j /tmp/cfg_qos.json --write-to-db
Signed-off-by: Stepan Blyschak <[email protected]>1 parent 544584e commit 4c7e54a
4 files changed
Lines changed: 1574 additions & 190 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3141 | 3141 | | |
3142 | 3142 | | |
3143 | 3143 | | |
3144 | | - | |
| 3144 | + | |
3145 | 3145 | | |
3146 | 3146 | | |
3147 | 3147 | | |
| |||
3187 | 3187 | | |
3188 | 3188 | | |
3189 | 3189 | | |
3190 | | - | |
3191 | | - | |
3192 | | - | |
3193 | | - | |
| 3190 | + | |
| 3191 | + | |
| 3192 | + | |
| 3193 | + | |
| 3194 | + | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
3194 | 3198 | | |
| 3199 | + | |
| 3200 | + | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
| 3205 | + | |
| 3206 | + | |
| 3207 | + | |
| 3208 | + | |
| 3209 | + | |
| 3210 | + | |
3195 | 3211 | | |
3196 | 3212 | | |
3197 | 3213 | | |
| |||
0 commit comments