Browse files

Updated riak backend to work with the latest client (2.0.1)

  • Loading branch information...
1 parent 5d42897 commit d4e3f4bc990861e97c7f0547ca28ac8b12ce07fb @mcobzarenco mcobzarenco committed Sep 21, 2013
Showing with 5 additions and 5 deletions.
  1. +5 −5 beaker_extensions/riak_.py
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()

0 comments on commit d4e3f4b

Please sign in to comment.