Enable auto-unit formatting in script output
authorIustin Pop <iustin@google.com>
Sun, 23 Nov 2008 15:34:50 +0000 (15:34 +0000)
committerIustin Pop <iustin@google.com>
Sun, 23 Nov 2008 15:34:50 +0000 (15:34 +0000)
commit9fbfbb7b1a1bd958a04bf482b180861862b06c26
treecfdbbc2865f150b2e66d6840805720c071f529d5
parent23b8c8d6daf9a0cbd082e354aba9a257e608ca4e
Enable auto-unit formatting in script output

This patch enables by default the old 'human-readable' option, but in a
slightly different model.

The option is now called "units" and takes either:
 - 'h' for automatic formatting
 - 'm', 'g' or 't' for mebi/gibi/tebibytes

If 'h' is used, we add a unit suffix, otherwise nothing is added so that
parsing is easy.

The default value of this unit is:
  - 'h' if a separator is not passed
  - 'm' if a separator is passed

Reviewed-by: ultrotter
lib/cli.py
lib/utils.py
scripts/gnt-instance
scripts/gnt-job
scripts/gnt-node
scripts/gnt-os
test/ganeti.utils_unittest.py