-
Notifications
You must be signed in to change notification settings - Fork 3
feat: enable various outputs (yaml, json) for clusterstatus #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
(pending py38 drop #53 , so i can remove the try/except) |
adf5fa9
to
3c41e1f
Compare
3c41e1f
to
4499bd6
Compare
output = f"""\ | ||
Status: {status} | ||
VMs: {vms - templates} | ||
Templates: {templates} | ||
Metrics: | ||
CPU: {_get_cpu_output()} | ||
Memory: {_get_memory_output()} | ||
Disk: {_get_disk_output()} | ||
Nodes: | ||
Offline: {len([node for node in proxmox.nodes if node.status == NodeStatus.OFFLINE])} | ||
Online: {len([node for node in proxmox.nodes if node.status == NodeStatus.ONLINE])} | ||
Unknown: {len([node for node in proxmox.nodes if node.status == NodeStatus.UNKNOWN])} | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a sense we can argue that this provides a "better output", but in the other hand I was quite fine with the previous output. I feel like it was intentional to prepend every lines with a double space and start the output with a \n
to clearly delimitate the output from previous logs (INFO:root:Proxmox cluster: XXX
for instance).
Any thoughts about it @lcaflc?
4499bd6
to
55b9757
Compare
55b9757
to
9092ef5
Compare
-o format
) option forclusterstatus
-o md
) (kudos @abuisine suggestion)