Commit d643176e authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

pithos:Ensure serial registration before commission

Commit transaction before accepting the commission
and delete registered serials after successful commission.

Refs: #3594
parent afb8048e
......@@ -124,10 +124,19 @@ def backend_method(func=None, autocommit=1):
self.queue.send(*m)
if serials:
self.quotaholder_serials.insert_many(serials)
# commit to ensure that the serials are registered
# even if accept commission fails
self.wrapper.commit()
self.wrapper.execute()
self.quotaholder.accept_commission(
context = {},
clientkey = 'pithos',
serials = serials)
self.quotaholder_serials.delete_many(serials)
self.wrapper.commit()
return ret
except:
......
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