Better serialization of Enoslib objects
Enos serializes the Enoslib "env" to disk: https://github.com/BeyondTheClouds/enos/blob/0d784ffe7228636812f7fdfa1ef48dc523d65935/enos/cli.py#L648
I don't think it's a good idea, but I want to keep it working. Updating to Enoslib 8 broke this feature because many internal Enoslib classes have changed, most notably around custom container (in the Python sense) objects.
I "fixed" it by serializing these objects on the Enos side, calling the custom to_dict()
method that is prevalent in Enoslib:
https://github.com/BeyondTheClouds/enos/commit/3a77f943b4694a74aa5277803250155d088ef231
However, this changes the serialized format, because it adds an extra data
attribute to all these custom container objects. Here is a concrete impact on the Grid'5000 Jenkins test:
# With current Enos
enos info --out json | jq -r '.rsc.network[0].address'
# With Enoslib 8 and Enos 8.0.0a4 (alpha version)
enos info --out json | jq -r '.rsc.data.network.data[0].address'
I find it a bit silly to break compatibility this way, and the extra attribute is annoying.
I would like to implement proper serialization on the Enoslib side that would keep compatibility as much as possible.