From 4c6f201d4956cb5377a684656c65d41342b19efe Mon Sep 17 00:00:00 2001 From: Peter Stachowski Date: Tue, 19 Apr 2016 19:43:51 +0000 Subject: [PATCH] Display min/max correctly from config-param-list When you run 'trove configuration-parameter-list' the CLI displays a table without any values in the 'min_size' and 'max_size' fields. The values now display correctly, and missing ones are represented by '-' (in the case of string parameters). Change-Id: Ib3a006aba4524e8e2fd4293449c54ee9d1dcabd1 Closes-Bug: #1572272 --- .../fix-config-param-list-output-27bf30fce5388d4b.yaml | 5 +++++ troveclient/v1/shell.py | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/fix-config-param-list-output-27bf30fce5388d4b.yaml diff --git a/releasenotes/notes/fix-config-param-list-output-27bf30fce5388d4b.yaml b/releasenotes/notes/fix-config-param-list-output-27bf30fce5388d4b.yaml new file mode 100644 index 00000000..50575b05 --- /dev/null +++ b/releasenotes/notes/fix-config-param-list-output-27bf30fce5388d4b.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - The CLI output from configuration-parameter-list + was fixed to properly display the 'Min Size' and + 'Max Size' values. Bug 1572272 diff --git a/troveclient/v1/shell.py b/troveclient/v1/shell.py index d6549ff3..a6fb393e 100644 --- a/troveclient/v1/shell.py +++ b/troveclient/v1/shell.py @@ -1360,8 +1360,12 @@ def do_configuration_parameter_list(cs, args): raise exceptions.NoUniqueMatch('The datastore name or id is required' ' to retrieve the parameters for the' ' configuration group by name.') - utils.print_list(params, ['name', 'type', 'min_size', 'max_size', - 'restart_required']) + for param in params: + setattr(param, 'min', getattr(param, 'min', '-')) + setattr(param, 'max', getattr(param, 'max', '-')) + utils.print_list( + params, ['name', 'type', 'min', 'max', 'restart_required'], + labels={'min': 'Min Size', 'max': 'Max Size'}) @utils.arg('configuration_group', metavar='',