1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-18 12:06:08 +00:00

utils/doc: Fix display of Falsey default parameters

Explicitly check for is `None` to determine if a default value is
not present or just a Falsey value.
This commit is contained in:
Marc Bonnici 2021-01-11 14:41:16 +00:00 committed by setrofim
parent 4ddd610149
commit e3703f0e1e

View File

@ -285,7 +285,7 @@ def get_params_rst(parameters):
text += indent('\nallowed values: {}\n'.format(', '.join(map(format_literal, param.allowed_values))))
elif param.constraint:
text += indent('\nconstraint: ``{}``\n'.format(get_type_name(param.constraint)))
if param.default:
if param.default is not None:
value = param.default
if isinstance(value, str) and value.startswith(USER_HOME):
value = value.replace(USER_HOME, '~')