Commit 08c0c980 authored by Sofia Papagiannaki's avatar Sofia Papagiannaki

pithos: Fix reconcile resources command

* Provision quantity sent should not be of type Decimal
  (not JSON serializable)
* Fix check for user existance in the database
parent 72056180
......@@ -77,8 +77,10 @@ class Command(NoArgsCommand):
users = set(db_usage.keys())
if userid and userid not in users:
self.stdout.write("User '%s' does not exist in DB!\n" % userid)
return
if backend._lookup_account(userid) is None:
self.stdout.write("User '%s' does not exist in DB!\n" %
userid)
return
# Get holding from Quotaholder
try:
......@@ -161,4 +163,4 @@ def create_provision(provision_info):
return {"holder": user,
"source": DEFAULT_SOURCE,
"resource": resource,
"quantity": db_value - qh_value}
"quantity": int(db_value - qh_value)}
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