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
This commit is contained in:
Ashleigh Farnham
2015-02-02 15:30:49 -08:00
parent 96e44b5a9b
commit b76eac2b0c

View File

@@ -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',