Skip to content

Commit 1a8c944

Browse files
committed
KeyError handling when searching a ecnryption object from aaa converter
1 parent d1044af commit 1a8c944

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

netjsonconfig/backends/airos/converters.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ def get_psk(interface):
4444
return t
4545

4646
def is_wpa2_personal(interface):
47-
return interface['encryption']['protocol'] == 'wpa2_personal'
47+
try:
48+
return interface['encryption']['protocol'] == 'wpa2_personal'
49+
except:
50+
return False
4851

4952
try:
5053
return [get_psk(i) for i in wireless if is_wpa2_personal(i)][0]

0 commit comments

Comments
 (0)