def get_interface(iface):
 adapters = _parse_interfaces()
 if (iface in adapters):
  try:
   if (iface == 'source'):
    template = JINJA.get_template('debian_source.jinja')
   else:
    template = JINJA.get_template('debian_eth.jinja')
  except jinja2.exceptions.TemplateNotFound:
   log.error('Could not load template debian_eth.jinja')
   return ''
  ifcfg = template.render({'name': iface, 'data': adapters[iface]})
  return [(item + '\n') for item in ifcfg.split('\n')]
 else:
  return []

def get_interface ( iface ) : adapters = _parse_interfaces ( ) if ( iface in adapters ) : try : if ( iface == 'source' ) : template = JINJA . get_template ( 'debian_source.jinja' ) else : template = JINJA . get_template ( 'debian_eth.jinja' ) except jinja2 . exceptions . TemplateNotFound : log . error ( 'Could not load template debian_eth.jinja' ) return '' ifcfg = template . render ( { 'name' : iface , 'data' : adapters [ iface ] } ) return [ ( item + '\n' ) for item in ifcfg . split ( '\n' ) ] else : return [ ]
return the configuration of a network interface cli example: .