ironic_python_agent.encoding module

class ironic_python_agent.encoding.RESTJSONEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: JSONEncoder

A slightly customized JSON encoder.

default(o)[source]

Turn an object into a serializable object.

In particular, by calling Serializable.serialize() on o.

encode(o)[source]

Turn an object into JSON.

Appends a newline to responses when configured to pretty-print, in order to make use of curl less painful from most shells.

class ironic_python_agent.encoding.Serializable[source]

Bases: object

Base class for things that can be serialized.

serializable_fields = ()
serialize()[source]

Turn this object into a dict.

class ironic_python_agent.encoding.SerializableComparable[source]

Bases: Serializable

A Serializable class which supports some comparison operators

This class supports the ‘__eq__’ and ‘__ne__’ comparison operators, but intentionally disables the ‘__hash__’ operator as some child classes may be mutable. The addition of these comparison operators is mainly used to assist with unit testing.

ironic_python_agent.encoding.serialize_lib_exc(exc)[source]

Serialize an ironic-lib exception.