forked from openstack/blazar
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add validation to ensure unique capabilities when needed and device name
Added a validation method `validate_capability_value` to the `ComputeHostExtraCapability` model to enforce uniqueness of `ExtraCapability`'s `capability_name` when its `is_unique=True`. This validation ensures that only one capability is allowed for each resource when is_unique is set to True. If a duplicate entry is found, a ValueError is raised with details about the non-unique capability and the affected compute host. Set Uniqueness for `name` in `Device` model Change-Id: I523a133abe15797cfb5b0b0edc830918dbe26f15
- Loading branch information
1 parent
b6c92ac
commit 14d8182
Showing
3 changed files
with
27 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters