@classmethod
def get_server_ip(cls, server, validation_resources=None):
    "Get the server fixed or floating IP.\n\n        Based on the configuration we're in, return a correct ip\n        address for validating that a guest is up.\n\n        :param server: The server dict as returned by the API\n        :param validation_resources: The dict of validation resources\n            provisioned for the server.\n        "
    if (CONF.validation.connect_method == 'floating'):
        if validation_resources:
            return validation_resources['floating_ip']['ip']
        else:
            msg = 'When validation.connect_method equals floating, validation_resources cannot be None'
            raise lib_exc.InvalidParam(invalid_param=msg)
    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()
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.

:param server: The server dict as returned by the API
:param validation_resources: The dict of validation resources
    provisioned for the server.
@classmethod
def get_server_ip(cls, server, validation_resources=None):
    "Get the server fixed or floating IP.\n\n        Based on the configuration we're in, return a correct ip\n        address for validating that a guest is up.\n\n        :param server: The server dict as returned by the API\n        :param validation_resources: The dict of validation resources\n            provisioned for the server.\n        "
    if (CONF.validation.connect_method == 'floating'):
        if validation_resources:
            return validation_resources['floating_ip']['ip']
        else:
            msg = 'When validation.connect_method equals floating, validation_resources cannot be None'
            raise lib_exc.InvalidParam(invalid_param=msg)
    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()