-
Notifications
You must be signed in to change notification settings - Fork 665
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
Update override_config_table for multi-asic platforms #2620
Update override_config_table for multi-asic platforms #2620
Conversation
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) |
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.
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.
Updated not to add an additional "ns" parameter
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(): |
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.
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.
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.
config/main.py
Outdated
@@ -1943,18 +1944,18 @@ def update_config(current_config, config_input): | |||
return updated_config | |||
|
|||
|
|||
def override_config_db(config_db, config_input): | |||
def override_config_db(ns, config_db, config_input): |
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.
closing this in favor of #2738 |
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)