Commit f09da99
authored
[show] Add bgpraw to show run all (#2537)
#### What I did
Add bgpraw output to `show runningconfiguration all`
```
Requirements:
1. current `show runningconfig` will print all the ConfigDB in a json format, we need to add a new key-value into the json output "bgpraw" with a long string value
2. The long string value should be the output of `vtysh -c "show run"`. It is normally multiline string, may include special characters like \". Need to make sure the escaping properly
3. We do not need to insert the key-value into ConfigDB is not existing there
4. If ConfigDB already has the key-value, we do not need to override it by vtysh command output
5. Not break multi-asic use
```
#### How I did it
Generate bgpraw output then append it to `show runnningconfiguration all`'s output
#### How to verify it
Mannual test
#### Previous command output (if the output of a command-line utility has changed)
```
admin@vlab-01:~$ show run all
{
"ACL_TABLE": {
......
"WRED_PROFILE": {
"AZURE_LOSSLESS": {
"ecn": "ecn_all",
"green_drop_probability": "5",
"green_max_threshold": "2097152",
"green_min_threshold": "1048576",
"red_drop_probability": "5",
"red_max_threshold": "2097152",
"red_min_threshold": "1048576",
"wred_green_enable": "true",
"wred_red_enable": "true",
"wred_yellow_enable": "true",
"yellow_drop_probability": "5",
"yellow_max_threshold": "2097152",
"yellow_min_threshold": "1048576"
}
}
}
```
#### New command output (if the output of a command-line utility has changed)
```
admin@vlab-01:~$ show run all
{
"ACL_TABLE": {
......
"WRED_PROFILE": {
"AZURE_LOSSLESS": {
"ecn": "ecn_all",
"green_drop_probability": "5",
"green_max_threshold": "2097152",
"green_min_threshold": "1048576",
"red_drop_probability": "5",
"red_max_threshold": "2097152",
"red_min_threshold": "1048576",
"wred_green_enable": "true",
"wred_red_enable": "true",
"wred_yellow_enable": "true",
"yellow_drop_probability": "5",
"yellow_max_threshold": "2097152",
"yellow_min_threshold": "1048576"
}
},
"bgpraw": "Building configuration...\n\nCurrent configuration......end\n"
}
```1 parent 39ac564 commit f09da99
2 files changed
Lines changed: 75 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
132 | 137 | | |
133 | 138 | | |
134 | 139 | | |
| |||
1383 | 1388 | | |
1384 | 1389 | | |
1385 | 1390 | | |
1386 | | - | |
1387 | | - | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
1388 | 1410 | | |
1389 | 1411 | | |
1390 | 1412 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
0 commit comments