Unify the query fields for the storage framework
This patch unifies the query fields in the storage framework for all types. Note that the information is still computed on-demand, so if e.g. the used disk space is not requested for the ‘file’ type, it won't be computed on nodes. Summary of changes: - improve the LVM storage type to support multiple lvm fields in the LIST_FIELDS declaration and constant (not-computed via lvm commands) fields - rename utils.GetFilesystemFreeSpace to utils.GetFilesystemStats returning tuple of (total, free) - add used and free as valid fields for lvm-vg (use being computed as vg_size-vg_free) - make allocatable accepted for all types (ones which are always allocatable always return True) - add a new list field ‘type’ that gives the current selected type; not much useful today (except for understanding what the default output is) but in the future might help if we want to list multiple types - add type, size and allocatable to the default output field list - update the man page with details on how, for file storage, size ≠ used + free for non-mountpoint cases Signed-off-by:Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
Showing
- lib/cmdlib.py 11 additions, 10 deletionslib/cmdlib.py
- lib/constants.py 8 additions, 5 deletionslib/constants.py
- lib/storage.py 44 additions, 18 deletionslib/storage.py
- lib/utils.py 6 additions, 4 deletionslib/utils.py
- man/gnt-node.sgml 32 additions, 14 deletionsman/gnt-node.sgml
- scripts/gnt-node 35 additions, 23 deletionsscripts/gnt-node
Loading
Please register or sign in to comment