-
Notifications
You must be signed in to change notification settings - Fork 138
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
Inactive NFS export validation #2924 #2926
Inactive NFS export validation #2924 #2926
Conversation
Enable intended NFS model field validations during POST & PUT by calling NFSExportGroup.clean_fields() prior to model.save(). N.B. There exists a build-in `choices=` field validator that takes precedence for the fields: 'editable', and 'syncable'. So only the 'host_str' field actively exercises the custom validators. I.e. we have redundant validators for 'editable', and 'syncable'. This redundancy is not the focus of this fix: only re-enabling model field validation. ## Includes - Above fix regarding model field validation. - Incidental fix for newer Django warning surfaced by recent NFS test updates: "Pagination may yield inconsistent results with an unordered object_list ...". Adds a default ordering on `id` in NFSExportGroup model. - Remove outdated model comment regarding editable default: NFSExportGroup model - nfs_export_group.py model definition file black re-formatted.
TestingBeforeSee the associated issue #2924 (comment) for details of the existing test failures: detailing model field validation failure. AfterOn a Leap 15.6 host (x86_64) via rpm (built on host) install from this PR branch (5.0.14-2926): Pertinent test set
All tests(A prerequisite of a successful rpmbuild) As per doc instructions: https://rockstor.com/docs/contribute/contribute.html#code-test
|
Web-UI back-end validation feedbackAs per referenced issue #2924 reproducer re allowed "1.!" host_str, using the same input thus: Results in our Web-UI user error feedback dialog:
Indicating our successfully surfacing this newly enabled model field validation. Also, no export was entered into the DB (no model.save() ), and no export was created on the underlying NFS config (/etc/exports). |
Enable intended NFS model field validations during POST & PUT by calling NFSExportGroup.clean_fields() prior to model.save().
N.B. There exists a build-in
choices=
field validator that takes precedence for the fields: 'editable', and 'syncable'. So only the 'host_str' field actively exercises the custom validators. I.e. we have redundant validators for 'editable', and 'syncable'. This redundancy is not the focus of this fix: only re-enabling model field validation.Fixes #2924
Includes
id
in NFSExportGroup model.