Closed Marzona closed 8 years ago
The function relies on the structure of the hostname passed as string. name length, structure of the strings considering dot separation..
I would simply try a name resolution and catch the exception. This will allow us to avoid to bother for new FQDN, ipv6 compatibility and such..
moreover the function should raise exception and not return true/false.
commit 01841c1 refactors _is_valid_hostname(), as the original was causing an exception when passed an empty string. Also makes some changes and an addition to test_ui.py also pushed to devel.
The function relies on the structure of the hostname passed as string. name length, structure of the strings considering dot separation..
I would simply try a name resolution and catch the exception. This will allow us to avoid to bother for new FQDN, ipv6 compatibility and such..
moreover the function should raise exception and not return true/false.