def _check_multiple_ips_to_host(config):
 host_ip_map = {}
 for (groupnames, group) in config.items():
  if ('_hosts' in groupnames):
   for (hostname, entries) in group.items():
    if (hostname not in host_ip_map):
     host_ip_map[hostname] = entries['ip']
    else:
     current_ip = host_ip_map[hostname]
     new_ip = entries['ip']
     if (not (current_ip == new_ip)):
      raise MultipleIpForHostError(hostname, current_ip, new_ip)
 logger.debug('No hosts with multiple IPs found.')
 return True

def _check_multiple_ips_to_host ( config ) : host_ip_map = { } for ( groupnames , group ) in config . items ( ) : if ( '_hosts' in groupnames ) : for ( hostname , entries ) in group . items ( ) : if ( hostname not in host_ip_map ) : host_ip_map [ hostname ] = entries [ 'ip' ] else : current_ip = host_ip_map [ hostname ] new_ip = entries [ 'ip' ] if ( not ( current_ip == new_ip ) ) : raise MultipleIpForHostError ( hostname , current_ip , new_ip ) logger . debug ( 'No hosts with multiple IPs found.' ) return True
check for multiple ips assigned to a single hostname .