ceph / ceph-medic

find common issues in ceph clusters
MIT License
22 stars 18 forks source link

add json output --format option #158

Open bigjust opened 3 years ago

bigjust commented 3 years ago

Adds a new flag --format, which takes either 'json' or 'term' (default). if 'json' returns a json structure of the results normally printed to the terminal

resolves #142, resolves #119

bigjust commented 3 years ago

@zmc I made some changes to pass around the terminal object to make it easier to pass around some state, and the runner object as well, which required some changes in the tests to account for the new structure. Also added the results to the metadata in order to output as json. We could dump the whole json structure, but i was going for terminal output compatibility/consistency