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 , bssid , hidden_ssid , protocol , radio , split_cidr , ssid , wireless
7+ from .interface import autonegotiation , bridge , bssid , flowcontrol , hidden_ssid , protocol , radio , split_cidr , ssid , wireless
88from .radius import radius_from_interface
99from .schema import default_ntp_servers
1010from .radio import radio_device_base , radio_configuration
@@ -260,26 +260,6 @@ def type_to_role(self, typestr):
260260 }
261261 return roles .get (typestr , '' )
262262
263- def autoneg_status (self , interface ):
264- if interface .get ('autoneg' ):
265- return 'enabled'
266- else :
267- return 'disabled'
268-
269- def flowcontrol_status (self , interface ):
270- if interface .get ('flowcontrol' ):
271- status = 'enabled'
272- else :
273- status = 'disabled'
274- return {
275- 'rx' : {
276- 'status' : status ,
277- },
278- 'tx' : {
279- 'status' : status ,
280- },
281- }
282-
283263 def to_intermediate (self ):
284264 result = []
285265 interfaces = []
@@ -294,9 +274,9 @@ def to_intermediate(self):
294274 }
295275 # handle interface type quirks
296276 if interface ['type' ] == 'ethernet' and '.' not in interface ['name' ]:
297- base ['autoneg' ] = self . autoneg_status (interface )
277+ base ['autoneg' ] = autonegotiation (interface )
298278
299- base ['flowcontrol' ] = self . flowcontrol_status (interface )
279+ base ['flowcontrol' ] = flowcontrol (interface )
300280
301281 if interface ['type' ] == 'wireless' :
302282 base ['devname' ] = radio (interface )
0 commit comments