def get_manual_interface_attributes(interface, module):
 if (get_interface_type(interface) == 'svi'):
  command = ('show interface ' + interface)
  try:
   body = execute_modified_show_for_cli_text(command, module)[0]
  except (IndexError, ShellError):
   return None
  command_list = body.split('\n')
  desc = None
  admin_state = 'up'
  for each in command_list:
   if ('Description:' in each):
    line = each.split('Description:')
    desc = line[1].strip().split('MTU')[0].strip()
   elif ('Administratively down' in each):
    admin_state = 'down'
  return dict(description=desc, admin_state=admin_state)
 else:
  return None

def get_manual_interface_attributes ( interface , module ) : if ( get_interface_type ( interface ) == 'svi' ) : command = ( 'show interface ' + interface ) try : body = execute_modified_show_for_cli_text ( command , module ) [ 0 ] except ( IndexError , ShellError ) : return None command_list = body . split ( '\n' ) desc = None admin_state = 'up' for each in command_list : if ( 'Description:' in each ) : line = each . split ( 'Description:' ) desc = line [ 1 ] . strip ( ) . split ( 'MTU' ) [ 0 ] . strip ( ) elif ( 'Administratively down' in each ) : admin_state = 'down' return dict ( description = desc , admin_state = admin_state ) else : return None
gets admin state and description of a svi interface .