def create_lag_port(network_switch, port_name, lag_mode='active', lag_group=1, native_vlan=1, allowed_vlans='all'):
 debug = False
 new_port = SwitchPort.objects.get_or_create(port_name=port_name, mode='trunk', trunk_native_vlan=native_vlan, trunk_allowed_vlans=allowed_vlans, lag_enabled=True, lag_mode=lag_mode, lag_group=lag_group, network_switch=network_switch)
 if debug:
  print new_port

def create_lag_port ( network_switch , port_name , lag_mode = 'active' , lag_group = 1 , native_vlan = 1 , allowed_vlans = 'all' ) : debug = False new_port = SwitchPort . objects . get_or_create ( port_name = port_name , mode = 'trunk' , trunk_native_vlan = native_vlan , trunk_allowed_vlans = allowed_vlans , lag_enabled = True , lag_mode = lag_mode , lag_group = lag_group , network_switch = network_switch ) if debug : print new_port
create a switchport object - lag .