'Get the server fixed or floating IP.
Based on the configuration we\'re in, return a correct ip
address for validating that a guest is up.'

@classmethod
def get_server_ip(cls, server):

    if (CONF.validation.connect_method == 'floating'):
        return cls.validation_resources['floating_ip']['ip']
    elif (CONF.validation.connect_method == 'fixed'):
        addresses = server['addresses'][CONF.validation.network_for_ssh]
        for address in addresses:
            if (address['version'] == CONF.validation.ip_version_for_ssh):
                return address['addr']
        raise exceptions.ServerUnreachable(server_id=server['id'])
    else:
        raise lib_exc.InvalidConfiguration()
