Skip to content

Commit

Permalink
Fix review comments:
Browse files Browse the repository at this point in the history
- Fix alignment error
- Update DEVICE_METADATA|localhost.buffer_model only if it is changed

Signed-off-by: Stephen Sun <stephens@nvidia.com>
  • Loading branch information
stephenxs committed Dec 8, 2020
1 parent a63b850 commit aee20c1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1630,8 +1630,8 @@ def _update_buffer_calculation_model(config_db, model):
device_metadata = config_db.get_entry('DEVICE_METADATA', 'localhost')
if device_metadata.get('buffer_model') != model:
buffer_model_changed = True
device_metadata['buffer_model'] = model
config_db.set_entry('DEVICE_METADATA', 'localhost', device_metadata)
device_metadata['buffer_model'] = model
config_db.set_entry('DEVICE_METADATA', 'localhost', device_metadata)
return buffer_model_changed

@qos.command('reload')
Expand Down
2 changes: 1 addition & 1 deletion tests/mock_tables/config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@
"BUFFER_PROFILE|alpha_profile": {
"dynamic_th": "0",
"pool": "[BUFFER_POOL|ingress_lossless_pool]",
"headroom_type": "dynamic"
"headroom_type": "dynamic"
},
"BUFFER_PG|Ethernet0|3-4": {
"profile": "NULL"
Expand Down
6 changes: 3 additions & 3 deletions tests/mock_tables/state_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,9 @@
"type": "ingress"
},
"BUFFER_PROFILE_TABLE|ingress_lossy_profile": {
"dynamic_th": "3",
"pool": "[BUFFER_POOL_TABLE|ingress_lossy_pool]",
"size": "0"
"dynamic_th": "3",
"pool": "[BUFFER_POOL_TABLE|ingress_lossy_pool]",
"size": "0"
},
"BUFFER_PROFILE_TABLE|headroom_profile": {
"dynamic_th": "0",
Expand Down

0 comments on commit aee20c1

Please sign in to comment.