Mark Goddard c66679f14b Support nested objects and object lists in as_dict
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
2018-02-22 00:29:58 +00:00
2018-02-02 11:21:29 +00:00
2013-05-02 14:55:43 -04:00
2013-10-28 10:19:15 +00:00
2013-07-22 09:51:10 +02:00
2017-11-21 21:02:52 +01:00
2017-08-21 17:41:52 -04:00
2013-05-02 14:55:43 -04:00
2017-08-21 17:41:52 -04:00
2017-03-02 11:45:27 +00:00
2018-02-15 10:29:21 +01:00
2015-08-07 09:51:32 +00:00

Team and repository tags

image

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

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

Description
A service for managing and provisioning Bare Metal servers.
Readme 303 MiB
Languages
Python 98.1%
Shell 1.9%