34b3589ea3
Attributes which are mandatory (ie, required for object creation) should not be removable. However, some attributes (such as Node.chassis_uuid) are not required for object creation, but should not be removable if they are set. This commit does the following: - rename JsonPatchType.mandatory_attrs to non_removable_attrs to better describe its meaning, - change its return type to set-of-strings for faster lookup - ensure all mandatory attributes on the type being patched are included in the set of non-removable attributes, - add a new field, JsonPatchType._extra_non_removable_attrs, which should be a set of attributes that are not required for creation but should not be removed if set. Since the object to be patched does not exist at patch-validation time, we leave the validation logic in methods of JsonPatchType and subclasses. This means introspecting the types to be patched. Closes-Bug: #1284781 Change-Id: I2bb7fed2c776c8d63535c5ee19cdc218e57806e3 |
||
---|---|---|
.. | ||
functional | ||
unit | ||
__init__.py | ||
base.py |