-
Notifications
You must be signed in to change notification settings - Fork 72
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
Consistently replace '_' with '-' in hostnames #1619
Conversation
It is not a valid FQDN character, and some platforms (like Cumulus NVUE) fail with an error We could consider restricting node names to be valid FQDNs of at most 16 characters, and apply the 'replace' normalization in Python rather than all templates
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.
There is no need for such a change. Many platforms accept both.
Whichever platform cannot deal with a valid node identifier should solve its own issues in a configuration template.
Also:
- Did you test all these changes? Are you sure they work?
- Why did you not change the hostname mappings if you want to enforce consistency?
Just because you have a problem with NVUE does not mean everything else has to change. Submit a PR for those platforms that cannot handle '_' and I'll merge it.
Many platforms accept both, Ubuntu for example simply ignores the '_' characters and a Most of the platforms I have access to - eos, cumulus, dell os10, linux - use the character substitution. The immediate issue was with Cumulus NVUE, but - for example - Cisco AVA is reported to have similar issues. I think users would be better off if they stayed away from using '_' in hostnames, lacking that the next best thing is - imho - to replace '_' with '-', rather than let it be ignored and hope it doesn't cause issues. We could make that configurable, while I did not test the other platforms I think it is reasonable to expect the hostname to work at least as well with a '-', and possibly better. I can submit a PR for only Cumulus NVUE, I do not have access to most other platforms so I don't really care for myself. But I thought it'd be nice for the community |
You should have done that in the first place.
Copiously illustrated in #1623. Also: stop "fixing" stuff you don't care about and have no intention of testing.
Maybe it's just me, but in my personal opinion the community might appreciate a tested and working software more. |
Still waiting for the changes to be implemented. Converting to draft. |
Replaced by #1682 |
It is not a valid FQDN character, and some platforms (like Cumulus NVUE) fail with an error
We could consider restricting node names to be valid FQDNs (of at most 16 characters), and/or apply the 'replace' normalization in Python rather than all templates (either define a
node.hostname
property and use that everywhere instead ofinventory_hostname
, or changeinventory_hostname
(and issue an error when troublesome node names are used)