From 012729981350c638dcf7bcc608f688a8c5ef25c1 Mon Sep 17 00:00:00 2001 From: Sushil Kumar Date: Tue, 31 Dec 2013 07:46:29 +0000 Subject: [PATCH] Adds volume_used to trove show 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 --- troveclient/v1/shell.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/troveclient/v1/shell.py b/troveclient/v1/shell.py index 87225948..72f38959 100644 --- a/troveclient/v1/shell.py +++ b/troveclient/v1/shell.py @@ -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)