Skip to content
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

[yang-models] device_metadata validation issue #9574

Closed
ganglyu opened this issue Dec 17, 2021 · 1 comment
Closed

[yang-models] device_metadata validation issue #9574

ganglyu opened this issue Dec 17, 2021 · 1 comment
Assignees
Labels
YANG YANG model related changes

Comments

@ganglyu
Copy link
Contributor

ganglyu commented Dec 17, 2021

Description

'DEVICE_METADATA': {'localhost': {'bgp_asn': '65100',
'cloudtype': 'Public',
'deployment_id': '1',
'docker_routing_config_mode': 'separated',
'downstream_subrole': 'downstream_subrole_y',
'hostname': 'switch-t0',
'hwsku': 'Force10-S6000',
'region': 'usfoo',
'resource_type': 'resource_type_x',
'synchronous_mode': 'enable',
'type': 'ToRRouter'}},

Config db schema generated by minigraph can’t pass yang validation:

  • there's no downstream_subrole field in sonic-device_metadata.yang

It seems that we need to update sonic-config-engine or yang model.

Steps to reproduce the issue:

  1. Run command 'sonic-cfggen -m tests/simple-sample-graph-metadata.xml --print-data'.
  2. Use sonic_yang to validate config db schema.

Describe the results you received:

Yang validation failed.

Describe the results you expected:

Yang validation should pass.

Output of show version:

(paste your output here)

Output of show techsupport:

(paste your output here or download and attach the file here )

Additional information you deem important (e.g. issue happens only occasionally):

@ganglyu ganglyu added the YANG YANG model related changes label Dec 17, 2021
@ganglyu
Copy link
Contributor Author

ganglyu commented Dec 17, 2021

@anish-n
https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml#L261-L265
If downstream_subrole is necessary, could you please update sonic-device_metadata.yang?

qiluo-msft pushed a commit that referenced this issue Jan 14, 2022
#### Why I did it
As a fix for #9574

#### How I did it
Enhance yang model for networking-metadata

#### How to verify it
Unit testing
judyjoseph pushed a commit that referenced this issue Jan 23, 2022
#### Why I did it
As a fix for #9574

#### How I did it
Enhance yang model for networking-metadata

#### How to verify it
Unit testing
@ganglyu ganglyu closed this as completed Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
YANG YANG model related changes
Projects
None yet
Development

No branches or pull requests

2 participants