(container)
return ''
Returns the IP address of a specific container.
Returns the IP address of a specific container.
Returns the IP address of a specific container .
def get_ip(container):
    """ Returns the IP address of a specific container. """
    state = container.state()
    if state.network is None:  # container is not running
        return ''
    eth0 = state.network['eth0']
    # TODO: we only use IPv4 addresses for now. This should be updated in order to better support
    # IPv6 addresses and LXD bridges configured for IPv6.
    for addr in eth0['addresses']:
        if addr['family'] == 'inet':
            return addr['address']
    return ''
def get_ip ( container ) : state = container . state ( ) if state . network is None : # container is not running return '' eth0 = state . network [ 'eth0' ] # TODO: we only use IPv4 addresses for now. This should be updated in order to better support # IPv6 addresses and LXD bridges configured for IPv6. for addr in eth0 [ 'addresses' ] : if addr [ 'family' ] == 'inet' : return addr [ 'address' ] return ''