#NEWLINE# def _host_dhcp( fixedip ) : #NEWLINE# #INDENT# 'Return a host string for an address in dhcp-host format.' #NEWLINE# hostname = fixedip . instance . hostname #NEWLINE# if ( len ( hostname ) > 63 ) : #NEWLINE# #INDENT# LOG . warning ( _LW ( 'hostname %s too long, truncating.' ) , hostname ) #NEWLINE# hostname = ( ( fixedip . instance . hostname [ : 2 ] + '-' ) + fixedip . instance . hostname [ ( - 60 ) : ] ) #NEWLINE# #UNINDENT# if CONF . use_single_default_gateway : #NEWLINE# #INDENT# net = _host_dhcp_network ( fixedip . virtual_interface_id ) #NEWLINE# return ( '%s,%s.%s,%s,net:%s' % ( fixedip . virtual_interface . address , hostname , CONF . dhcp_domain , fixedip . address , net ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( '%s,%s.%s,%s' % ( fixedip . virtual_interface . address , hostname , CONF . dhcp_domain , fixedip . address ) )