'returns the ip (floating/internal) of a server'

def _get_server_ip(self, server, floating=False):

    if floating:
        server_ip = self.floating_ips[server['id']]['floating_ip_address']
    else:
        server_ip = None
        network_name = self.tenants[server['tenant_id']].network['name']
        if (network_name in server['addresses']):
            server_ip = server['addresses'][network_name][0]['addr']
    return server_ip
