Skip to content

Commit 8782688

Browse files
committed
[airos] fixed default for interface encryption, added docstrings
1 parent eaf4ba1 commit 8782688

4 files changed

Lines changed: 11 additions & 2 deletions

File tree

netjsonconfig/backends/airos/interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def encryption(interface):
2929
"""
3030
Return the encryption dict for a wireless interface
3131
"""
32-
return interface['wireless']['encryption']
32+
return interface['wireless'].get('encryption', {'protocol': 'none'})
3333

3434

3535
def flowcontrol(interface):

netjsonconfig/backends/airos/radius.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ def authentication(interface):
4848

4949

5050
def ap_accounting(interface):
51+
"""
52+
Returns the ``acct`` dict for ``access_point`` interfaces
53+
"""
5154
result = {}
5255
if protocol(interface) == 'wpa2_enterprise':
5356
enc = encryption(interface)
@@ -59,6 +62,9 @@ def ap_accounting(interface):
5962
return result
6063

6164
def sta_accounting(interface):
65+
"""
66+
Returns the ``acct`` dict for ``station`` interfaces
67+
"""
6268
return {}
6369

6470

netjsonconfig/backends/airos/wireless.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828

2929

3030
def status(interface):
31+
"""
32+
Return the ``wireless`` status
33+
"""
3134
if interface.get('disabled'):
3235
return 'disabled'
3336
else:

netjsonconfig/backends/airos/wpasupplicant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from interface import encryption, ssid
1+
from .interface import encryption, ssid
22

33

44
def ap_no_encryption(interface):

0 commit comments

Comments
 (0)