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

Add helper function to validate interface name length #931

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

stepanblyschak
Copy link
Contributor

@stepanblyschak stepanblyschak commented Oct 21, 2024

This PR is accompanied by sonic-net/sonic-buildimage#20108 and sonic-net/sonic-utilities#3580

Add helper function to validate that interface name length does not exceed allowed length configured as IFNAMSIZ. This will be used both by sonic-utilities CLI (config) and by cfgmgr.


#if defined(SWIG) && defined(SWIGPYTHON)
%pythoncode %{
def is_interface_name_valid(iface_name):
Copy link
Contributor

Choose a reason for hiding this comment

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

If python could call isInterfaceNameValid, no need to define another one just different with function name. We previoslyu defined some python function due to SWIG could not automatically translate function from one language to another, like C++ missing dynamic features.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't have a strong argument besides that I wanted to keep original author's intent to have a function named in snake_case style

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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