Make host/interface/cname unique
- Host names are unique (no 2 hosts with same name) - A host name shall not conflict with a cname or interface (if not main interface) - Interface names are unique (no 2 interfaces with same name) - An interface shall not conflict with a cname or host (if not assigned host) - cnames are only unique by domain (2 cnames can have the same name if different domains) - A cname shall not conflict with a host or interface - An interface has to be linked to a host Validation is implemented at the model level. Some is also implemented at the form level as it gives nicer feedback, but not all as it's a bit more complex when it requires check on several fields. JIRA INFRA-245
Showing
- app/api/network.py 3 additions, 2 deletionsapp/api/network.py
- app/models.py 80 additions, 5 deletionsapp/models.py
- app/network/forms.py 8 additions, 1 deletionapp/network/forms.py
- app/network/views.py 96 additions, 64 deletionsapp/network/views.py
- app/static/js/hosts.js 0 additions, 12 deletionsapp/static/js/hosts.js
- app/templates/network/create_host.html 0 additions, 1 deletionapp/templates/network/create_host.html
- app/validators.py 28 additions, 0 deletionsapp/validators.py
- migrations/versions/6b65e1309431_cname_shall_only_be_unique_by_domain.py 23 additions, 0 deletions...ions/6b65e1309431_cname_shall_only_be_unique_by_domain.py
- migrations/versions/7c38e78b6de6_interface_host_shall_not_be_nullable.py 24 additions, 0 deletions...ions/7c38e78b6de6_interface_host_shall_not_be_nullable.py
- tests/functional/factories.py 17 additions, 16 deletionstests/functional/factories.py
- tests/functional/test_api.py 78 additions, 42 deletionstests/functional/test_api.py
- tests/functional/test_models.py 77 additions, 4 deletionstests/functional/test_models.py
- tests/functional/test_web.py 14 additions, 16 deletionstests/functional/test_web.py
Loading
Please register or sign in to comment