(hosts, ips)
Update hosts that have an entry in the floating IP list
Update hosts that have an entry in the floating IP list
Update hosts that have an entry in the floating IP list
def iter_host_ips(hosts, ips):
    '''Update hosts that have an entry in the floating IP list'''
    for host in hosts:
        host_id = host[1]['id']

        if host_id in ips:
            ip = ips[host_id]

            host[1].update({
                'access_ip_v4': ip,
                'access_ip': ip,
                'public_ipv4': ip,
                'ansible_ssh_host': ip,
            })

        if 'use_access_ip' in host[1]['metadata'] and host[1]['metadata']['use_access_ip'] == "0":
                host[1].pop('access_ip')

        yield host
def iter_host_ips ( hosts , ips ) : for host in hosts : host_id = host [ 1 ] [ 'id' ] if host_id in ips : ip = ips [ host_id ] host [ 1 ] . update ( { 'access_ip_v4' : ip , 'access_ip' : ip , 'public_ipv4' : ip , 'ansible_ssh_host' : ip , } ) if 'use_access_ip' in host [ 1 ] [ 'metadata' ] and host [ 1 ] [ 'metadata' ] [ 'use_access_ip' ] == "0" : host [ 1 ] . pop ( 'access_ip' ) yield host