'Returns the most recent API version.'

def get_volume_api_version(self):

    self.interface = self._get_client_option(CLIENT_NAME, 'endpoint_type')
    try:
        self.context.keystone_session.get_endpoint(service_type=self.VOLUME_V3, interface=self.interface)
        self.service_type = self.VOLUME_V3
        self.client_version = '3'
    except ks_exceptions.EndpointNotFound:
        try:
            self.context.keystone_session.get_endpoint(service_type=self.VOLUME_V2, interface=self.interface)
            self.service_type = self.VOLUME_V2
            self.client_version = '2'
        except ks_exceptions.EndpointNotFound:
            raise exception.Error(_('No    volume    service    available.'))
