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

[sonic-py-common] Strip the MAC before returning from get_system_mac() #21591

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

vvolam
Copy link
Contributor

@vvolam vvolam commented Jan 31, 2025

Why I did it

There is a corner case where the MAC address includes a trailing "\n" character in the config_db.json file, leading to switch configuration failure.

Work item tracking
  • Microsoft ADO (number only): 28355624

How I did it

To prevent this issue, the final return statement now explicitly strips the MAC in all cases from get_system_mac().

How to verify it

Load the new image to verify the mac does not contain any trailing unnecessary characters in the config_db.json file/

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

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305
  • 202311
  • 202405
  • 202411

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

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

There is a corner case where the MAC address includes a trailing "\n"
character, leading to switch configuration failure. To prevent this issue,
the final return statement now explicitly strips the MAC in all cases.
This commit implements that fix.

Signed-off-by: Vasundhara Volam <vvolam@microsoft.com>
@vvolam vvolam requested a review from saiarcot895 January 31, 2025 23:25
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #21602

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202411: #21604

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

Successfully merging this pull request may close these issues.

7 participants