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 @@ -15,26 +15,6 @@ def status(config, key='disabled'):
1515 return 'enabled'
1616
1717
18- def get_psk (interface ):
19- t = {
20- 'wpa' : {
21- 'psk' : interface ['wireless' ]['encryption' ]['key' ],
22- },
23- }
24- return t
25-
26-
27- def is_wpa2_personal (interface ):
28- """
29- returns True if the interface is configured with wpa2_personal
30- authentication
31- """
32- try :
33- return interface ['wireless' ]['encryption' ]['protocol' ] == 'wpa2_personal'
34- except :
35- return False
36-
37-
3818class AirOsConverter (BaseConverter ):
3919 """
4020 Always run the converter from NetJSON
@@ -69,36 +49,6 @@ def wireless(self):
6949 """
7050 return wireless (get_copy (self .netjson , 'interfaces' , []))
7151
72- def status (self ):
73- """
74- The aaa.status value is enabled when the interface is in access_point mode
75- with wpa2_personal authentication
76- """
77- try :
78- t = self .wireless ()[0 ]['wireless' ]
79- if t ['mode' ] == 'access_point' and t ['encryption' ]['protocol' ] == 'wpa2_personal' :
80- return 'enabled'
81- else :
82- return 'disabled'
83- except :
84- # catch both KeyError and IndexError
85- return 'disabled'
86-
87- def ap_psk (self ):
88- t = self .wireless ()[0 ]['wireless' ]
89- temp = {
90- 'radius.macacl.status' : 'disabled' ,
91- 'ssid' : t ['ssid' ],
92- 'devname' : t ['radio' ],
93- 'driver' : 'madwifi' ,
94- 'wpa.1.pairwise' : 'CCMP' ,
95- 'wpa.key.1rmgmt' : 'WPA-PSK' ,
96- 'wpa.mode' : 2 ,
97- }
98- if t ['mode' ] == 'access_point' and t ['encryption' ]['protocol' ] == 'wpa2_personal' :
99- return temp
100- else :
101- return {}
10252
10353 def to_intermediate (self ):
10454 result = []
You can’t perform that action at this time.
0 commit comments