Merge lp:~mpontillo/maas/bug-1433622-disallow-absolute-fqdn-cluster-names into lp:~maas-committers/maas/trunk
Proposed by
Mike Pontillo
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Mike Pontillo | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 3770 | ||||
Proposed branch: | lp:~mpontillo/maas/bug-1433622-disallow-absolute-fqdn-cluster-names | ||||
Merge into: | lp:~maas-committers/maas/trunk | ||||
Diff against target: |
251 lines (+113/-17) 5 files modified
src/maasserver/api/tests/test_node.py (+1/-1) src/maasserver/models/nodegroup.py (+27/-1) src/maasserver/models/tests/test_nodegroup.py (+30/-0) src/maasserver/utils/dns.py (+35/-15) src/maasserver/utils/tests/test_dns.py (+20/-0) |
||||
To merge this branch: | bzr merge lp:~mpontillo/maas/bug-1433622-disallow-absolute-fqdn-cluster-names | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Blake Rouse (community) | Approve | ||
Andres Rodriguez (community) | Needs Information | ||
Review via email: mp+254826@code.launchpad.net |
Commit message
Add a validator for domain names, and use it to validate the NodeGroup (cluster) name. In addition, add a CharField subclass specific to DNS names, which will strip any trailing '.' before saving to the database, and make use of the validator by default.
Description of the change
Refactored the hostname validator to separate hostname validation functionality from domain name validation functionality.
Added DomainNameField, a CharField subclass whose sole job is to normalize DNS names by removing all whitespace and trailing '.' characters, and use the new validator.
To post a comment you must log in.
As discussed over IRC, using a final '.' in a zone is allowed per standard and MAAS would need to support this.
This means that if a user inputs the zone in the cluster controller page as:
'maas.com.' or 'maas.'
it should continue to be allowed and should have the same result as:
'maas.com' or 'maas'
That being said, even when a zone in the form of 'maas.com' or 'maas' is given, DNS config files are written with a final '.':
@ IN SOA maas.com. nobody.example.com. (
or
@ IN SOA maas. nobody.example.com. (