From b7d40c2a52bc2e49123de30e56f7245f44cfed08 Mon Sep 17 00:00:00 2001 From: wangyao Date: Wed, 29 Nov 2017 19:53:55 +0800 Subject: [PATCH] Fix datastore abnormal display with trove backup-show According bug description, the datastore display abnormal when use trove backup-show. The cause of the problem is method _print_object unformatted datastore from result. Fix by formatted datastore where necessary. Change-Id: Ifbcc8312e52eb3d052f5d24645d4d243ec50aed7 Closes-Bug: #1735157 --- troveclient/v1/shell.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/troveclient/v1/shell.py b/troveclient/v1/shell.py index c9efed02..21ef93f8 100644 --- a/troveclient/v1/shell.py +++ b/troveclient/v1/shell.py @@ -143,6 +143,12 @@ def _print_object(obj): obj._info['id'] = obj.id del(obj._info['str_id']) + # Get datastore type and version, where necessary + if hasattr(obj, 'datastore'): + if 'type' in obj.datastore: + obj._info['datastore'] = obj.datastore['type'] + obj._info['datastore_version'] = obj.datastore['version'] + utils.print_dict(obj._info)