Commit 649a8d7a authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

Reset erroneous commit

parent d5c9fa3b
......@@ -91,7 +91,7 @@ def _compute_statistics(nodes):
cluster=cluster))
return statistics
def _get_verified_quota(statistics, default_quota=0):
def _get_verified_quota(statistics):
""" Verify statistics and set quotaholder account quota """
add_quota = []
append = add_quota.append
......@@ -110,19 +110,12 @@ def _get_verified_quota(statistics, default_quota=0):
print e
continue
else:
s = select([table['policy'].c.value])
s = s.where(table['policy'].c.node == item.node)
s = s.where(table['policy'].c.key == 'quota')
policy = conn.execute(s).fetchone()
capacity = policy.value if policy else 0
if capacity:
capacity -= default_quota
append(AddQuotaPayload(
holder=item.path,
resource='pithos+.diskspace',
key=ENTITY_KEY,
quantity=db_item.size,
capacity=capacity,
capacity=0,
import_limit=0,
export_limit=0))
return add_quota
......@@ -146,11 +139,11 @@ class Command(NoArgsCommand):
account_nodes = conn.execute(s).fetchall()
# compute account statistics
statistics = _compute_statistics(
account_nodes, default_quota=backend.DEFAULT_QUOTA)
statistics = _compute_statistics(account_nodes)
# verify and send quota
add_quota = _get_verified_quota(statistics)
result = backend.quotaholder.add_quota(
context={},
clientkey='pithos',
......
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