def is_default_interface(interface, module):
 command = ('show run interface ' + interface)
 try:
  body = execute_show_command(command, module, command_type='cli_show_ascii')[0]
 except IndexError:
  body = ''
 if body:
  raw_list = body.split('\n')
  found = False
  for line in raw_list:
   if line.startswith('interface'):
    found = True
   if (found and line and (not line.startswith('interface'))):
    return False
  return True
 else:
  return 'DNE'

def is_default_interface ( interface , module ) : command = ( 'show run interface ' + interface ) try : body = execute_show_command ( command , module , command_type = 'cli_show_ascii' ) [ 0 ] except IndexError : body = '' if body : raw_list = body . split ( '\n' ) found = False for line in raw_list : if line . startswith ( 'interface' ) : found = True if ( found and line and ( not line . startswith ( 'interface' ) ) ) : return False return True else : return 'DNE'
checks to see if interface exists and if it is a default config args: interface : full name of interface .