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
This commit is contained in:
Peter Stachowski 2016-04-19 19:43:51 +00:00
parent 1084741cd0
commit 4c6f201d49
2 changed files with 11 additions and 2 deletions

View File

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

View File

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