File tree Expand file tree Collapse file tree
netjsonconfig/backends/airos Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44from ...utils import get_copy
55from ..base .converter import BaseConverter
6+ from .aaa import bridge_devname , profile_from_interface , status_from_interface
67from .interface import bridge , wireless
78from .radius import radius_from_interface
89from .schema import default_ntp_servers
@@ -53,30 +54,20 @@ def radius(self):
5354 return original
5455
5556 def to_intermediate (self ):
57+ base = {}
5658 result = []
57- temp = {
58- 'radius' : {
59- 'acct' : [
60- {
61- 'port' : 1813 ,
62- 'status' : 'disabled' ,
63- },
64- ],
65- 'auth' : [
66- {
67- 'port' : 1812 ,
68- },
69- ],
70- },
71- 'status' : 'disabled' ,
72- }
73- result .append ({
74- 'status' : self .status (),
75- })
76- result .append ([ temp , ])
77- w = self .wpa2_personal ()
78- if w :
79- result .append ([w ])
59+ try :
60+ wireless = self .wireless [0 ]
61+ bridge = self .bridge [0 ]
62+ base .update (profile_from_interface (wireless ))
63+ base .update (status_from_interface (wireless ))
64+ base .update (radius_from_interface (wireless ))
65+ base .update (bridge_devname (wireless , bridge ))
66+ except IndexError :
67+ raise Exception ('input is missing a wireless or bridge interface' )
68+ result .append (status_from_interface (wireless ))
69+ result .append ([base ])
70+
8071 return (('aaa' , result ),)
8172
8273
You can’t perform that action at this time.
0 commit comments