Overview of cliutils
develcliutils is a Python library designed to create cluster-aware CLI tools for Gluster. It acts as a wrapper around the gluster system:: execute command, allowing a single executable to function as both a node component (running on all peers) and a user-facing CLI (run from a single node).
Key Advantages:
- Node Awareness: The
execute_in_peersfunction merges output withgluster peer statusto identify offline nodes, whereas the standardsystem:: executesimply skips them. - Error Handling: Provides utility functions like
node_output_okandnode_output_notokthat return JSON (including success/failure status and node UUID) instead of relying on shell exit codes, which can be unreliable when aggregating output from multiple nodes. - Simplified CLI: Provides easy handling of CLI arguments and allows for easy iteration over node-specific outputs.