def get_dhcp_opts(context, network_ref, fixedips):
 gateway = network_ref['gateway']
 if (network_ref['multi_host'] and (not (network_ref['share_address'] or CONF.share_dhcp_address))):
  gateway = network_ref['dhcp_server']
 hosts = []
 if CONF.use_single_default_gateway:
  for fixedip in fixedips:
   if fixedip.allocated:
    vif_id = fixedip.virtual_interface_id
    if fixedip.default_route:
     hosts.append(_host_dhcp_opts(vif_id, gateway))
    else:
     hosts.append(_host_dhcp_opts(vif_id))
 else:
  hosts.append(_host_dhcp_opts(None, gateway))
 return '\n'.join(hosts)

def get_dhcp_opts ( context , network_ref , fixedips ) : gateway = network_ref [ 'gateway' ] if ( network_ref [ 'multi_host' ] and ( not ( network_ref [ 'share_address' ] or CONF . share_dhcp_address ) ) ) : gateway = network_ref [ 'dhcp_server' ] hosts = [ ] if CONF . use_single_default_gateway : for fixedip in fixedips : if fixedip . allocated : vif_id = fixedip . virtual_interface_id if fixedip . default_route : hosts . append ( _host_dhcp_opts ( vif_id , gateway ) ) else : hosts . append ( _host_dhcp_opts ( vif_id ) ) else : hosts . append ( _host_dhcp_opts ( None , gateway ) ) return '\n' . join ( hosts )
get networks hosts config in dhcp-opts format .