@@ -144,6 +144,31 @@ def __init__(self, device_cfg, *args, **kwargs):
144144 self .config ['session_log_record_writes' ] = True
145145 self .config ['session_log_file_mode' ] = 'append'
146146
147+ _NUMERIC_CAST = {
148+ "port" : int ,
149+ "global_delay_factor" : float ,
150+ "conn_timeout" : float ,
151+ "auth_timeout" : float ,
152+ "banner_timeout" : float ,
153+ "blocking_timeout" : float ,
154+ "timeout" : float ,
155+ "session_timeout" : float ,
156+ "read_timeout_override" : float ,
157+ "keepalive" : int ,
158+ }
159+
160+ for key , expected_type in _NUMERIC_CAST .items ():
161+ value = self .config .get (key )
162+ if isinstance (value , str ):
163+ try :
164+ self .config [key ] = expected_type (value )
165+ except ValueError :
166+ LOG .error (
167+ "Invalid value %s for %s; expected %s" ,
168+ value , key , expected_type .__name__ ,
169+ )
170+ raise exc .GenericSwitchNetmikoConfigError ()
171+
147172 self .lock_kwargs = {
148173 'locks_pool_size' : int (self .ngs_config ['ngs_max_connections' ]),
149174 'locks_prefix' : self .config .get (
@@ -435,7 +460,7 @@ def unplug_bond_from_network(self, bond, segmentation_id,
435460 segmentation_id = segmentation_id )
436461 for sub_port in trunk_details .get ('sub_ports' , []):
437462 cmds += self ._format_commands (
438- self .ADD_NETWORK_TO_BOND_TRUNK , bond = bond ,
463+ self .DELETE_NETWORK_ON_BOND_TRUNK , bond = bond ,
439464 segmentation_id = sub_port ['segmentation_id' ])
440465
441466 if ngs_port_default_vlan :
0 commit comments