The value returned by ironic.objects.IronicObject.as_dict() should be a plain object, in order for it to be serialised to JSON. Currently, nested object fields and object list fields are not converted to dict format. This caused problems during cleaning, when the node object's as_dict representation is JSON encoded and sent to IPA. This change adds support for calling as_dict() on nested objects and list objects, to ensure these are also returned in dict form. We also change the method used in as_dict() for checking whether an object has an attribute. The hasattr() function used previously has problems when used with properties in python 2 [1], in that any exceptions raised in the property getter result in hasattr() returning False. Instead we use obj_attr_is_set() to determine whether the object has a particular attribute. [1] https://hynek.me/articles/hasattr/ Change-Id: Ib2166040508827db28d6f6e2d9a3e655c16f2993 Closes-Bug: #1750027
Team and repository tags
Ironic
Ironic consists of an API and plug-ins for managing and provisioning physical machines in a security-aware and fault-tolerant manner. It can be used with nova as a hypervisor driver, or standalone service using bifrost. By default, it will use PXE and IPMI to interact with bare metal machines. Ironic also supports vendor-specific plug-ins which may implement additional functionality.
Ironic is distributed under the terms of the Apache License, Version 2.0. The full terms and conditions of this license are detailed in the LICENSE file.
Project resources
- Documentation: https://docs.openstack.org/ironic/latest
- Source: https://git.openstack.org/cgit/openstack/ironic
- Bugs: https://bugs.launchpad.net/ironic
- Wiki: https://wiki.openstack.org/wiki/Ironic
- APIs: https://developer.openstack.org/api-ref/baremetal/index.html
Project status, bugs, and requests for feature enhancements (RFEs) are tracked on Launchpad: https://launchpad.net/ironic
For information on how to contribute to ironic, see https://docs.openstack.org/ironic/latest/contributor