Fix error with configuration-parameter-show

According bug description, there will be an error when
use  configuration-parameter-show without version_id
and datastore. To fix this problem, I add an judgement
for use the cmd without parameter datstore and
datastore_version not like an uuid.

Now in such a case, the cmd will has an exception info.

Change-Id: I01fd56bad80f389da369be90dff5c89b05e6a8dc
Closes-Bug: #1363065
This commit is contained in:
wangyao
2017-12-21 16:46:06 +08:00
parent f92e624653
commit e3a7d83ea1

View File

@@ -1601,6 +1601,11 @@ def do_configuration_parameter_show(cs, args):
param = cs.configuration_parameters.get_parameter_by_version(
args.datastore_version,
args.parameter)
else:
raise exceptions.NoUniqueMatch(_('The datastore name or id is'
' required to retrieve the'
' parameter for the configuration'
' group by name.'))
_print_object(param)