Revision 369a7b41 snf-pithos-backend/pithos/backends/modular.py

b/snf-pithos-backend/pithos/backends/modular.py
94 94
DEFAULT_BLOCK_MODULE = 'pithos.backends.lib.hashfiler'
95 95
DEFAULT_BLOCK_PATH = 'data/'
96 96
DEFAULT_BLOCK_UMASK = 0o022
97
DEFAULT_BLOCK_SIZE = 4 * 1024 * 1024  # 4MB
98
DEFAULT_HASH_ALGORITHM = 'sha256'
97 99
#DEFAULT_QUEUE_MODULE = 'pithos.backends.lib.rabbitmq'
98 100
DEFAULT_BLOCK_PARAMS = { 'mappool': None, 'blockpool': None }
99 101
#DEFAULT_QUEUE_HOSTS = '[amqp://guest:guest@localhost:5672]'
......
126 128

  
127 129
    def __init__(self, db_module=None, db_connection=None,
128 130
                 block_module=None, block_path=None, block_umask=None,
131
                 block_size=None, hash_algorithm=None,
129 132
                 queue_module=None, queue_hosts=None, queue_exchange=None,
130 133
                 astakos_url=None, service_token=None,
131 134
                 astakosclient_poolsize=None,
......
141 144
        block_path = block_path or DEFAULT_BLOCK_PATH
142 145
        block_umask = block_umask or DEFAULT_BLOCK_UMASK
143 146
        block_params = block_params or DEFAULT_BLOCK_PARAMS
147
        block_size = block_size or DEFAULT_BLOCK_SIZE
148
        hash_algorithm = hash_algorithm or DEFAULT_HASH_ALGORITHM
144 149
        #queue_module = queue_module or DEFAULT_QUEUE_MODULE
145 150
        account_quota_policy = account_quota_policy or DEFAULT_ACCOUNT_QUOTA
146 151
        container_quota_policy = container_quota_policy \
......
156 161
        #queue_hosts = queue_hosts or DEFAULT_QUEUE_HOSTS
157 162
        #queue_exchange = queue_exchange or DEFAULT_QUEUE_EXCHANGE
158 163

  
159
        self.public_url_security = public_url_security or DEFAULT_PUBLIC_URL_SECURITY
160
        self.public_url_alphabet = public_url_alphabet or DEFAULT_PUBLIC_URL_ALPHABET
164
        self.public_url_security = (public_url_security or
165
            DEFAULT_PUBLIC_URL_SECURITY)
166
        self.public_url_alphabet = (public_url_alphabet or
167
            DEFAULT_PUBLIC_URL_ALPHABET)
161 168

  
162
        self.hash_algorithm = 'sha256'
163
        self.block_size = 4 * 1024 * 1024  # 4MB
169
        self.hash_algorithm = hash_algorithm
170
        self.block_size = block_size
164 171
        self.free_versioning = free_versioning
165 172

  
166 173
        def load_module(m):

Also available in: Unified diff