ironic/ironic
Miles Gould 34b3589ea3 Get mandatory patch attrs from WSME properties
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
2015-11-17 14:34:20 +00:00
..
api Get mandatory patch attrs from WSME properties 2015-11-17 14:34:20 +00:00
cmd Enable cmd/api & cmd/conductor to be launched directly 2015-10-16 15:23:47 -07:00
common Merge "Add choices to temp_url_endpoint_type config option" 2015-11-16 15:15:16 +00:00
conductor Merge "Make task parameter mandatory in get_supported_boot_devices" 2015-11-13 12:19:06 +00:00
db Merge "Add db migration and model for tags table" 2015-10-23 04:46:39 +00:00
dhcp Replace deprecated LOG.warn with warning 2015-10-21 15:22:46 +03:00
drivers Merge "Make task parameter mandatory in get_supported_boot_devices" 2015-11-13 12:19:06 +00:00
locale Imported Translations from Zanata 2015-10-23 06:32:41 +00:00
nova Enable flake8 checking of ironic/nova/* 2015-06-12 11:48:20 -07:00
objects Merge "Follow up patch for 8c3e102fc5736bfcf98525ebab59b6598a69b428" 2015-11-10 16:54:09 +00:00
openstack Switch to the oslo_utils.fileutils 2015-07-15 08:07:32 +03:00
tests Get mandatory patch attrs from WSME properties 2015-11-17 14:34:20 +00:00
__init__.py Move eventlent monkeypatch out of cmd/ 2014-02-08 00:11:56 -08:00
netconf.py Enable translation for config option help messages 2015-07-06 10:57:53 -07:00
version.py Correct version.py and update current version string 2014-03-21 13:50:05 -07:00