summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshleigh Farnham <ashleighfarnham@gmail.com>2015-02-02 15:30:49 -0800
committerAshleigh Farnham <ashleighfarnham@gmail.com>2015-02-02 15:50:59 -0800
commitb76eac2b0cbcf8abd675e843c8c4ef83c3917ac3 (patch)
tree5fb73a8cc1e44e8d271a21a672cfdc6f36996826
parent96e44b5a9b7ca3caf6e3a43ec923d2bc49cca563 (diff)
downloadpython-troveclient-b76eac2b0cbcf8abd675e843c8c4ef83c3917ac3.tar.gz
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
-rw-r--r--troveclient/v1/shell.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/troveclient/v1/shell.py b/troveclient/v1/shell.py
index 5981f44..5f78142 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',