scheduler: fix incorrect log message

Here log message always uses 'minimum' in despite of the based_on
value.

Change-Id: I67962dba7318535cf3a5c7c1ddee9b0c23c13dbf
This commit is contained in:
Zhenzan Zhou
2015-10-21 15:32:44 +08:00
parent 876679c08f
commit d1f9015d5b

View File

@@ -60,10 +60,14 @@ def validate_num_values(vals, default=None, cast_to=int, based_on=min):
return default
if num_values > 1:
LOG.info(_LI("%(num_values)d values found, "
"of which the minimum value will be used."),
{'num_values': num_values})
if based_on == min:
LOG.info(_LI("%(num_values)d values found, "
"of which the minimum value will be used."),
{'num_values': num_values})
else:
LOG.info(_LI("%(num_values)d values found, "
"of which the maximum value will be used."),
{'num_values': num_values})
return based_on([cast_to(val) for val in vals])