From b76eac2b0cbcf8abd675e843c8c4ef83c3917ac3 Mon Sep 17 00:00:00 2001 From: Ashleigh Farnham Date: Mon, 2 Feb 2015 15:30:49 -0800 Subject: [PATCH] Show '-' for size when volume support disabled When volume support is disabled trove list does not contain include a volume attribute in the response. Previously we would only add a value for size when the volume attribute was present. This change adds a value of '-' when there is no volume attribute. This makes the behaviour consistent with the behaviour of nova list where the task state has no value. Change-Id: I75e5f7c493f3d2fe938ecc8663457953c58f6b02 Closes-Bug:1394591 --- troveclient/v1/shell.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/troveclient/v1/shell.py b/troveclient/v1/shell.py index 5981f447..5f781422 100644 --- a/troveclient/v1/shell.py +++ b/troveclient/v1/shell.py @@ -177,6 +177,8 @@ def do_list(cs, args): setattr(instance, 'flavor_id', instance.flavor['id']) if hasattr(instance, 'volume'): setattr(instance, 'size', instance.volume['size']) + else: + setattr(instance, 'size', '-') if hasattr(instance, 'datastore'): if instance.datastore.get('version'): setattr(instance, 'datastore_version',