Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 8 additions & 26 deletions riak/transports/feature_detect.py
Original file line number Diff line number Diff line change
@@ -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')
}


Expand Down
11 changes: 10 additions & 1 deletion riak/transports/tcp/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very short-term fix just until we merge KV/TS?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep or until this gets fixed: basho/riak#835

# GH-471 As of 20160509 Riak TS OSS 1.3.0 returns '0.8.0' as
# the version string.
return '2.1.1'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this impact the version-specified capabilities coming from the server?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what you mean ... if we leave it at 0.8.0, then a whole slew of features the Python client should support throw exceptions as being not supported.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once this is fixed in riak it will come back as, say, 1.3.0. Won't that also break the capabilities? I forget how this is handled for TS.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, right now in riak_ee the version is correct - 2.1.1. It's only in Riak TS OSS that it comes back 0.8.0.

return ver

def ping(self):
"""
Expand Down