Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #21 from reinferio/master

Updated Riak backend to work with the latest version of the client
  • Loading branch information...
commit f658f6480de9760c3e2a531598f175133e3e48ce 2 parents 70eed74 + d4e3f4b
@didip authored
Showing with 6 additions and 5 deletions.
  1. +1 −0  .gitignore
  2. +5 −5 beaker_extensions/riak_.py
View
1  .gitignore
@@ -1,3 +1,4 @@
+build
*.py?
*.egg-info
*.swp
View
10 beaker_extensions/riak_.py
@@ -19,22 +19,22 @@ def __init__(self, namespace, url=None, data_dir=None, lock_dir=None, **params):
NoSqlManager.__init__(self, namespace, url=url, data_dir=data_dir, lock_dir=lock_dir, **params)
def open_connection(self, host, port):
- self.db_conn = riak.RiakClient(host=host, port=int(port))
+ self.db_conn = riak.RiakClient(protocol='pbc', host=host, pb_port=int(port))
self.bucket = self.db_conn.bucket('beaker_cache')
def __contains__(self, key):
- return self.bucket.get(self._format_key(key)).exists()
+ return self.bucket.get(self._format_key(key)).exists
def set_value(self, key, value):
val = self.bucket.get(self._format_key(key))
- if not val.exists():
+ if not val.exists:
self.bucket.new(self._format_key(key), value).store()
else:
- val.set_data(value)
+ val.data = value
val.store()
def __getitem__(self, key):
- return self.bucket.get(self._format_key(key)).get_data()
+ return self.bucket.get(self._format_key(key)).data
def __delitem__(self, key):
self.bucket.get(self._format_key(key)).delete()
Please sign in to comment.
Something went wrong with that request. Please try again.