Handle non-200 codes in the multi-template return

This commit is contained in:
Joshua Boniface 2020-01-06 11:43:32 -05:00
parent a9edbe0234
commit 5edcd45ad6
1 changed files with 6 additions and 0 deletions

View File

@ -183,8 +183,14 @@ def list_template_storage_disks(name):
def template_list(limit):
system_templates, code = list_template_system(limit)
if code != 200:
system_templates = []
network_templates, code = list_template_network(limit)
if code != 200:
network_templates = []
storage_templates, code = list_template_storage(limit)
if code != 200:
storage_templates = []
return { "system_templates": system_templates, "network_templates": network_templates, "storage_templates": storage_templates }