Adds volume_used to trove show <instance>

Reasons:
- There are two attributes coming from trove related to volume
  attached, total size of volume and used space of volume.
- Used space is an important attribute for a user, it would help to
  plan the resize of volume before the attached volume gets finished.

Changes:
- Adds display of used volume attribut, with "trove show" command.
- Avoids display in dicts-form.
- do_show method now displays total space, and used space for the
  atttached volume, as

    |       status      |                ACTIVE                |
    |      updated      |         2014-01-12T22:17:20          |
    |       volume      |                  1                   |
    |    volume_used    |                 0.13                 |
    +-------------------+--------------------------------------+

Change-Id: I64bddd167c1645077854bd74185886bb45fc69a0
Closes-Bug: #1265144
This commit is contained in:
Sushil Kumar
2013-12-31 07:46:29 +00:00
parent 30587ea448
commit 0127299813

View File

@@ -117,6 +117,8 @@ def do_show(cs, args):
instance._info['flavor'] = instance.flavor['id']
if hasattr(instance, 'volume'):
instance._info['volume'] = instance.volume['size']
if 'used' in instance.volume:
instance._info['volume_used'] = instance.volume['used']
if hasattr(instance, 'ip'):
instance._info['ip'] = ', '.join(instance.ip)
_print_instance(instance)