Ensure single-element templates are lists
Ensures any list-assuming statements later on hold true even when there is only a single template entry.
This commit is contained in:
parent
b438b9b4c2
commit
6ac82d6ce9
|
@ -111,6 +111,9 @@ def list_template(limit, table, is_fuzzy=True):
|
|||
cur.execute(query, args)
|
||||
data = cur.fetchall()
|
||||
|
||||
if not isinstance(data, list):
|
||||
data = [ data ]
|
||||
|
||||
if table == 'network_template':
|
||||
for template_id, template_data in enumerate(data):
|
||||
# Fetch list of VNIs from network table
|
||||
|
|
Loading…
Reference in New Issue