Skip to content

Commit 296eeb9

Browse files
committed
[airos] split status and base in iptables converter
1 parent d749429 commit 296eeb9

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

netjsonconfig/backends/airos/converters.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,18 +264,20 @@ class Iptables(AirOsConverter):
264264
'portfw': {'status': 'disabled'},
265265
'status': 'enabled',
266266
},
267-
'status': 'disabled'
267+
}
268+
269+
_status = {
270+
'status': 'enabled',
268271
}
269272

270273
def bridge_intermediate(self):
271274
base = self._base.copy()
272-
return [base]
275+
iptables_status = self._status.copy()
276+
return [iptables_status, base]
273277

274278
def router_intermediate(self):
275279
base = self._base.copy()
276-
base.update({
277-
'status': 'enabled',
278-
})
280+
iptables_status = self._status.copy()
279281
base['sys'].update({
280282
'fw': {'status': 'disabled'},
281283
'mgmt': [
@@ -287,7 +289,7 @@ def router_intermediate(self):
287289
'mgmt.status': 'enabled',
288290
})
289291

290-
return [base]
292+
return [iptables_status, base]
291293

292294
def to_intermediate(self):
293295
result = getattr(self, '{netmode}_intermediate'.format(netmode=self.netmode))()

0 commit comments

Comments
 (0)