def interface_is_portchannel(interface, module):
 intf_type = get_interface_type(interface)
 if (intf_type == 'ethernet'):
  command = ('show interface ' + interface)
  body = execute_show_command(command, module)
  try:
   interface_table = body[0]['TABLE_interface']['ROW_interface']
  except (KeyError, AttributeError, IndexError):
   interface_table = None
  if interface_table:
   state = interface_table.get('eth_bundle')
   if state:
    return True
   else:
    return False
 return False

def interface_is_portchannel ( interface , module ) : intf_type = get_interface_type ( interface ) if ( intf_type == 'ethernet' ) : command = ( 'show interface ' + interface ) body = execute_show_command ( command , module ) try : interface_table = body [ 0 ] [ 'TABLE_interface' ] [ 'ROW_interface' ] except ( KeyError , AttributeError , IndexError ) : interface_table = None if interface_table : state = interface_table . get ( 'eth_bundle' ) if state : return True else : return False return False
checks to see if an interface is part of portchannel bundle args: interface : full name of interface .