From 7c8e27bb34476e1b4cc70b398345cb8df33d3728 Mon Sep 17 00:00:00 2001 From: Edoardo Putti Date: Thu, 20 Jul 2017 13:03:14 +0200 Subject: [PATCH] [airos] fixed broken tests --- netjsonconfig/backends/airos/intermediate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/netjsonconfig/backends/airos/intermediate.py b/netjsonconfig/backends/airos/intermediate.py index c44052368..2320b6008 100644 --- a/netjsonconfig/backends/airos/intermediate.py +++ b/netjsonconfig/backends/airos/intermediate.py @@ -88,14 +88,15 @@ def intermediate_to_list(configuration): result = [] for element in configuration: - temp = {} if isinstance(element, list): for index, el in enumerate(element): + temp = {} for key, value in el.items(): temp['{i}.{key}'.format(i=index + 1, key=key)] = value - result = result + intermediate_to_list([temp]) + result = result + intermediate_to_list([temp]) elif isinstance(element, dict): + temp = {} temp.update(shrink(element)) result.append(temp)