44from ...utils import get_copy
55from ..base .converter import BaseConverter
66from .aaa import bridge_devname , profile_from_interface , status_from_interface
7- from .interface import bridge , wireless
7+ from .interface import bridge , bssid , hidden_ssid , protocol , radio , ssid , wireless
88from .radius import radius_from_interface
99from .schema import default_ntp_servers
1010from .wpasupplicant import available_mode_authentication
@@ -624,8 +624,8 @@ def to_intermediate(self):
624624 for w in original :
625625 wireless_list .append ({
626626 'addmtikie' : 'enabled' ,
627- 'devname' : w [ 'wireless' ][ ' radio' ] ,
628- 'hide_ssid' : 'enabled' if w [ 'wireless' ]. get ( 'hidden' ) else 'disabled' ,
627+ 'devname' : radio ( w ) ,
628+ 'hide_ssid' : hidden_ssid ( w ) ,
629629 'l2_isolation' : 'disabled' ,
630630 'mac_acl' : {
631631 'policy' : 'allow' ,
@@ -642,8 +642,8 @@ def to_intermediate(self):
642642 'signal_led3' : 25 ,
643643 'signal_led4' : 15 ,
644644 'signal_led_status' : 'enabled' ,
645- 'ssid' : w [ 'wireless' ][ ' ssid' ] ,
646- 'ap' : w [ 'wireless' ]. get ( ' bssid' , '' ),
645+ 'ssid' : ssid ( w ) ,
646+ 'ap' : bssid ( w ),
647647 'status' : status (w ),
648648 'wds' : {'status' : 'enabled' },
649649 })
@@ -667,11 +667,11 @@ def _station_intermediate(self, original):
667667
668668 if original :
669669 head = original [0 ]
670- protocol = head [ 'wireless' ][ 'encryption' ][ ' protocol' ]
671- temp_dev ['devname' ] = head [ 'wireless' ][ ' radio' ]
672- network = station_auth_protocols [protocol ](head )
670+ proto = protocol ( head )
671+ temp_dev ['devname' ] = radio ( head )
672+ network = station_auth_protocols [proto ](head )
673673
674- if protocol == 'none' :
674+ if proto == 'none' :
675675 del temp_dev ['driver' ]
676676 del temp_dev ['devname' ]
677677
0 commit comments