Update override_config_table for multi-asic platforms#2620
Closed
judyjoseph wants to merge 3 commits intosonic-net:masterfrom
Closed
Update override_config_table for multi-asic platforms#2620judyjoseph wants to merge 3 commits intosonic-net:masterfrom
judyjoseph wants to merge 3 commits intosonic-net:masterfrom
Conversation
qiluo-msft
reviewed
Jan 24, 2023
config/main.py
Outdated
| print(json.dumps(updated_config, sort_keys=True, | ||
| indent=4, cls=minigraph_encoder)) | ||
| else: | ||
| override_config_db(ns, config_db, config_input) |
Contributor
Contributor
Author
There was a problem hiding this comment.
Updated not to add an additional "ns" parameter
qiluo-msft
reviewed
Jan 24, 2023
config/main.py
Outdated
| sys.exit(1) | ||
| # Do the yang validation and config override for host namespace and | ||
| # other namespaces in case of multi-asic platform | ||
| for ns, config_db in db.cfgdb_clients.items(): |
Contributor
Contributor
Author
There was a problem hiding this comment.
I have updated the logic to have a list of tables which is there per namespace, if any of the tables in the config_input json is present in that list, we do override config for all namespaces. Else only for host. Currently MACSEC_PROFILE is there in that table list.
this logic can be generalized to any table depending on how we plan to go with Virtual connector, to do this action based on table, and have it give back which connector to use, or which namespace the config needs to be overridden.
qiluo-msft
reviewed
Jan 24, 2023
config/main.py
Outdated
|
|
||
|
|
||
| def override_config_db(config_db, config_input): | ||
| def override_config_db(ns, config_db, config_input): |
Contributor
Contributor
Author
|
closing this in favor of #2738 |
This file contains hidden or 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
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
Update override_config_table for multi-asic platforms to apply the overriding config in golden_config_db.json to all namespaces in addition to the host namespace.
This will be removed later as we support the complete depreciation of minigraph and the golden_config_db.json file support the DB schema for multi-asic platforms.
How I did it
Check the db client list which contains the db connector to DB in multiple namespaces and do yang validation and config override.
How to verify it
Validated with MACSEC_PROFILE present in the golden_config_db.json file and checked that the MACSEC_PROFILE gets added/updated in the config_db's for host as well as the namespaces.
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)