mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-22 16:48:30 +01:00
Fix None rendered in jinja2
jinja2 render None to empty string Signed-off-by: Qian Deng <dengq@vmware.com>
This commit is contained in:
parent
4b6e2946c3
commit
0aaccf62b2
@ -36,6 +36,12 @@ def get_storage_provider_info(provider_name, provider_config):
|
||||
# generate storage configuration section in yaml format
|
||||
storage_provider_conf_list = [provider_name + ':']
|
||||
for config in provider_config_copy.items():
|
||||
storage_provider_conf_list.append('{}: {}'.format(*config))
|
||||
if config[1] is None:
|
||||
value = ''
|
||||
elif config[1] == True:
|
||||
value = 'true'
|
||||
else:
|
||||
value = config[1]
|
||||
storage_provider_conf_list.append('{}: {}'.format(config[0], value))
|
||||
storage_provider_info = ('\n' + ' ' * 4).join(storage_provider_conf_list)
|
||||
return storage_provider_info
|
||||
|
Loading…
Reference in New Issue
Block a user