Clevis info in stratis pool list --name [NAME] uses D-Bus types
jbaublitz opened this issue · 6 comments
jbaublitz commented
This is a little bit ugly and I think we'd probably prefer to make it Python types instead of D-Bus types for readability purposes.
jbaublitz commented
@mulkieran I'm assuming you'll want to take care of this one.
mulkieran commented
@jbaublitz Could you give an example of what you've seen?
jbaublitz commented
Sure!
~/ stratis pool list --name testpool
UUID: 43e74130-43f1-42bf-be0c-08f32aede4c6
Name: testpool
Alerts: 1
WS001: All devices fully allocated
Actions Allowed: fully_operational
Cache: No
Filesystem Limit: 100
Allows Overprovisioning: Yes
Key Description: testkey
Clevis Configuration: dbus.Struct((dbus.String('tang'), dbus.String('{"thp":"Zjzo7vxW_3WooTE290uH5PU9TiPYAWdVe0NpoGbrHR4","url":"localhost"}')), signature=None)
Space Usage:
Fully Allocated: Yes
Size: 9.98 GiB
Allocated: 9.98 GiB
Used: 527.37 MiB
mulkieran commented
The problem is that we invoke str()
on these D-Bus values, relying on dbus-python to render a usable string value, but in the case of a D-Bus struct it just defaults to __repr__
.
mulkieran commented
We'll have to write a Clevis-specific function for representing that particular D-Bus struct.
mulkieran commented
Likely we'll have to abstract a bit more, to get some kind of Clevis info class.