Skip to content

Commit 0276298

Browse files
committed
[airos] removed aaa method logic from converter
1 parent fd98535 commit 0276298

1 file changed

Lines changed: 0 additions & 50 deletions

File tree

netjsonconfig/backends/airos/converters.py

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff 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-
3818
class 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 = []

0 commit comments

Comments
 (0)