Skip to content

[minigraph.py]: Add peer switch hostname to device metadata#6405

Merged
lguohan merged 2 commits intosonic-net:masterfrom
theasianpianist:master
Jan 11, 2021
Merged

[minigraph.py]: Add peer switch hostname to device metadata#6405
lguohan merged 2 commits intosonic-net:masterfrom
theasianpianist:master

Conversation

@theasianpianist
Copy link
Contributor

@theasianpianist theasianpianist commented Jan 9, 2021

Signed-off-by: Lawrence Lee lawlee@microsoft.com

- Why I did it
To make the peer switch hostname easily accessible from config DB
- How I did it
Add peer_switch field to DEVICE_METADATA table
- How to verify it
Run the sonic-cfggen tests

- Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)
image

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
@theasianpianist
Copy link
Contributor Author

retest vsimage please

@theasianpianist
Copy link
Contributor Author

retest broadcom please

@theasianpianist
Copy link
Contributor Author

retest mellanox please

@lguohan
Copy link
Collaborator

lguohan commented Jan 11, 2021

az pipeline passes

@lguohan lguohan merged commit 3dd993e into sonic-net:master Jan 11, 2021
daall pushed a commit that referenced this pull request Jan 11, 2021
To make the peer switch hostname easily accessible from config DB. Add peer_switch field to DEVICE_METADATA table

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>

if bool(results['PEER_SWITCH']):
results['DEVICE_METADATA']['localhost']['subtype'] = 'DualToR'
if len(results['PEER_SWITCH'].keys()) > 1:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the underlying cause of the two peers entities? Is this coming from the GeminiPeeringLink property? If so, can we use the hostname from the graph to pick the correct peer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should never have two peer entities, it would only occur if there were an error in the minigraph (if it had two of the peering link tags).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants