diff --git a/bin/cinder-manage b/bin/cinder-manage index 6c8dd3e3953..021c1c8d4db 100755 --- a/bin/cinder-manage +++ b/bin/cinder-manage @@ -450,9 +450,21 @@ class ConfigCommands(object): def __init__(self): pass - def list(self): - for key, value in CONF.iteritems(): - if value is not None: + @args('param', nargs='?', default=None, + help='Configuration parameter to display (default: %(default)s)') + def list(self, param=None): + """List parameters configured for cinder. + + Lists all parameters configured for cinder unless an optional argument + is specified. If the parameter is specified we only print the + requested parameter. If the parameter is not found an appropriate + error is produced by .get*(). + """ + param = param and param.strip() + if param: + print '%s = %s' % (param, CONF.get(param)) + else: + for key, value in CONF.iteritems(): print '%s = %s' % (key, value) diff --git a/doc/source/man/cinder-manage.rst b/doc/source/man/cinder-manage.rst index 2776c975602..85e923e49f5 100644 --- a/doc/source/man/cinder-manage.rst +++ b/doc/source/man/cinder-manage.rst @@ -157,9 +157,9 @@ Cinder Storage Management Cinder Config ~~~~~~~~~~~~~ -``cinder-manage config list`` +``cinder-manage config list []`` - Displays the current configuration parameters (options) for Cinder. + Displays the current configuration parameters (options) for Cinder. The optional flag parameter may be used to display the configuration of one parameter. FILES =====