diff --git a/riak/transports/feature_detect.py b/riak/transports/feature_detect.py index 8f5808ac..87e30fbf 100644 --- a/riak/transports/feature_detect.py +++ b/riak/transports/feature_detect.py @@ -1,34 +1,16 @@ -""" -Copyright 2012 Basho Technologies, Inc. - -This file is provided to you under the Apache License, -Version 2.0 (the "License"); you may not use this file -except in compliance with the License. You may obtain -a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -""" - from distutils.version import LooseVersion from riak.util import lazy_property versions = { - 1: LooseVersion("1.0.0"), - 1.1: LooseVersion("1.1.0"), - 1.2: LooseVersion("1.2.0"), - 1.4: LooseVersion("1.4.0"), - 1.44: LooseVersion("1.4.4"), - 2.0: LooseVersion("2.0.0"), - 2.1: LooseVersion("2.1.0"), - 2.12: LooseVersion("2.1.2") + 1: LooseVersion('1.0.0'), + 1.1: LooseVersion('1.1.0'), + 1.2: LooseVersion('1.2.0'), + 1.4: LooseVersion('1.4.0'), + 1.44: LooseVersion('1.4.4'), + 2.0: LooseVersion('2.0.0'), + 2.1: LooseVersion('2.1.0'), + 2.12: LooseVersion('2.1.2') } diff --git a/riak/transports/tcp/transport.py b/riak/transports/tcp/transport.py index 8b7841b9..0d845875 100644 --- a/riak/transports/tcp/transport.py +++ b/riak/transports/tcp/transport.py @@ -78,7 +78,16 @@ def _get_codec(self, msg_code): # FeatureDetection API def _server_version(self): server_info = self.get_server_info() - return server_info['server_version'] + ver = server_info['server_version'] + (maj, min, patch) = [int(v) for v in ver.split('.')] + if maj == 0: + import datetime + now = datetime.datetime.now() + if now.year == 2016: + # GH-471 As of 20160509 Riak TS OSS 1.3.0 returns '0.8.0' as + # the version string. + return '2.1.1' + return ver def ping(self): """