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

FQDN_REGEX cannot match host names that have single-letter subdomains #343

Closed
lunkwill42 opened this issue Apr 15, 2024 · 0 comments
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@lunkwill42
Copy link
Collaborator

The problem

We have all of our CNaaS equipment on the .c.uninett.no domain. This is not supported by CNaaS-NMS, rendering us unable to use any setting that is validated by Pydantic using host_schema fields.

The source here is this:

FQDN_REGEX = r"([a-zA-Z0-9-]{1,63}\.)([a-z-][a-z0-9-]{1,62}\.?)+"

To reproduce

>>> import re
>>> from cnaas_nms.db import settings_fields as sf
>>> pattern = re.compile(sf.FQDN_REGEX)
>>> pattern.match("test.c.uninett.no")
>>> pattern.match("test.cd.uninett.no")
<re.Match object; span=(0, 18), match='test.cd.uninett.no'>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants