Commit 3b8f06e3 authored by Olga Brani's avatar Olga Brani
Browse files

Merge branch 'latest-quota' of https://code.grnet.gr/git/synnefo into latest-quota

parents 59092412 361c0343
......@@ -46,9 +46,9 @@ BACKEND_QUOTA = getattr(
BACKEND_VERSIONING = getattr(settings, 'PITHOS_BACKEND_VERSIONING', 'auto')
BACKEND_FREE_VERSIONING = getattr(settings, 'PITHOS_BACKEND_FREE_VERSIONING', True)
PITHOS_QUOTAHOLDER_URL = getattr(settings,
'PITHOS_QUOTAHOLDER_URL',
'http://127.0.0.1/api/quotaholder/v')
# Set the quota holder component URI
QUOTAHOLDER_URL = getattr(settings, 'PITHOS_QUOTAHOLDER_URL', '')
QUOTAHOLDER_TOKEN = getattr(settings, 'PITHOS_QUOTAHOLDER_TOKEN', '')
# Update object checksums when using hashmaps.
UPDATE_MD5 = getattr(settings, 'PITHOS_UPDATE_MD5', True)
......
......@@ -61,8 +61,8 @@ from pithos.api.settings import (BACKEND_DB_MODULE, BACKEND_DB_CONNECTION,
BACKEND_BLOCK_UMASK,
BACKEND_QUEUE_MODULE, BACKEND_QUEUE_HOSTS,
BACKEND_QUEUE_EXCHANGE,
PITHOS_QUOTAHOLDER_URL,
BACKEND_QUOTA, BACKEND_VERSIONING,
QUOTAHOLDER_URL, QUOTAHOLDER_TOKEN,
BACKEND_QUOTA, BACKEND_VERSIONING,
BACKEND_FREE_VERSIONING,
AUTHENTICATION_URL, AUTHENTICATION_USERS,
SERVICE_TOKEN, COOKIE_NAME)
......@@ -863,7 +863,8 @@ _pithos_backend_pool = PithosBackendPool(size=POOL_SIZE,
queue_module=BACKEND_QUEUE_MODULE,
queue_hosts=BACKEND_QUEUE_HOSTS,
queue_exchange=BACKEND_QUEUE_EXCHANGE,
quotaholder_url=PITHOS_QUOTAHOLDER_URL,
quotaholder_url=QUOTAHOLDER_URL,
quotaholder_token=QUOTAHOLDER_TOKEN,
free_versioning=BACKEND_FREE_VERSIONING)
......
......@@ -143,8 +143,8 @@ class ModularBackend(BaseBackend):
def __init__(self, db_module=None, db_connection=None,
block_module=None, block_path=None, block_umask=None,
queue_module=None, queue_hosts=None,
queue_exchange=None, quotaholder_url=None,
queue_module=None, queue_hosts=None, queue_exchange=None,
quotaholder_url=None, quotaholder_token=None,
free_versioning=True):
db_module = db_module or DEFAULT_DB_MODULE
db_connection = db_connection or DEFAULT_DB_CONNECTION
......@@ -202,7 +202,8 @@ class ModularBackend(BaseBackend):
self.queue = NoQueue()
self.quotaholder_url = quotaholder_url
self.quotaholder = QuotaholderClient(quotaholder_url)
self.quotaholder_token = quotaholder_token
self.quotaholder = QuotaholderClient(quotaholder_url, quotaholder_token)
self.serials = []
self.messages = []
......
......@@ -44,7 +44,8 @@ class PithosBackendPool(ObjectPool):
def __init__(self, size=None, db_module=None, db_connection=None,
block_module=None, block_path=None, block_umask=None,
queue_module=None, queue_hosts=None,
queue_exchange=None, quotaholder_url=None,
queue_exchange=None,
quotaholder_url=None, quotaholder_token=None,
free_versioning=True):
super(PithosBackendPool, self).__init__(size=size)
self.db_module = db_module
......@@ -55,7 +56,8 @@ class PithosBackendPool(ObjectPool):
self.queue_module = queue_module
self.queue_hosts = queue_hosts
self.queue_exchange = queue_exchange
self.quotaholder_url = quotaholder_url
self.quotaholder_url = quotaholder_url
self.quotaholder_token = quotaholder_token
self.free_versioning = free_versioning
def _pool_create(self):
......@@ -68,6 +70,7 @@ class PithosBackendPool(ObjectPool):
queue_hosts=self.queue_hosts,
queue_exchange=self.queue_exchange,
quotaholder_url=self.quotaholder_url,
quotaholder_token=self.quotaholder_token,
free_versioning=self.free_versioning)
backend._real_close = backend.close
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment