-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[sonic-cfggen]: Fix generated deployment_id #10154
Conversation
Signed-off-by: Gang Lv ganglv@microsoft.com
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.
lgtm
@arlakshm fyi |
@@ -1293,6 +1292,9 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw | |||
} | |||
} | |||
|
|||
if deployment_id: | |||
results['DEVICE_METADATA']['localhost']['deployment_id'] = deployment_id |
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.
src/sonic-config-engine/minigraph.py
Outdated
@@ -1293,6 +1292,9 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw | |||
} | |||
} | |||
|
|||
if deployment_id: |
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.
Signed-off-by: Gang Lv ganglv@microsoft.com
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.
lgtm
Why I did it Config db schema generated by minigraph can’t pass yang validation, deployment_id can’t be none for yang validation. How I did it Update minigraph.py, skip deployment_id with None value How to verify it Run UT for sonic-config-enginue. Run command 'sonic-cfggen -m tests/multi_npu_data/sample-minigraph-noportchannel.xml -p tests/multi_npu_data/sample_port_config-3.ini -n asic3 --print-data'. Signed-off-by: Gang Lv ganglv@microsoft.com
) What I did: Added Support for deployment_id parsing for Device Asic metadata. Why I did:- Deployment Id is used in BGP docker for FRR template generation. For multi-asic platforms running in namespace without deployment id as key in DEVICE_METADATA FRR template generation fails. This change is needed after this #10154 where if deployment_id is none we don't update DEVICE_METADA dictionary. How I verify:- Added unit-test.
) What I did: Added Support for deployment_id parsing for Device Asic metadata. Why I did:- Deployment Id is used in BGP docker for FRR template generation. For multi-asic platforms running in namespace without deployment id as key in DEVICE_METADATA FRR template generation fails. This change is needed after this #10154 where if deployment_id is none we don't update DEVICE_METADA dictionary. How I verify:- Added unit-test.
…ic-net#11454) What I did: Added Support for deployment_id parsing for Device Asic metadata. Why I did:- Deployment Id is used in BGP docker for FRR template generation. For multi-asic platforms running in namespace without deployment id as key in DEVICE_METADATA FRR template generation fails. This change is needed after this sonic-net#10154 where if deployment_id is none we don't update DEVICE_METADA dictionary. How I verify:- Added unit-test.
Signed-off-by: Gang Lv ganglv@microsoft.com
Why I did it
Config db schema generated by minigraph can’t pass yang validation, deployment_id can’t be none for yang validation.
How I did it
Update minigraph.py, skip deployment_id with None value
How to verify it
Run UT for sonic-config-enginue.
Run command 'sonic-cfggen -m tests/multi_npu_data/sample-minigraph-noportchannel.xml -p tests/multi_npu_data/sample_port_config-3.ini -n asic3 --print-data'.
Which release branch to backport (provide reason below if selected)
Description for the changelog
Fix #9592
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)