Add exceptions module

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
Add error checking to Node model

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
Remove now-redundant checks from NodeController

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
Use Node's new error checking

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
Shuffle args for NodeController._lock()

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
Update unit tests to pass with new strict checking

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
Move lock_many implementation to the model

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
Don't hardcode test engine_url

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
Set full path to test sqlite db

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
Add RaceConditionError

We'll raise this when the only way to avoid a race condition is to have
the client repeat the request

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
Retry when we hit a RaceConditionError

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
Simplify request handling

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
Set serializable isolation level by default

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
Add test for lock_many race condition

This test requires paddles to be running in a multi-worker mode, or else
it is skipped.

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
Add teardown method

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
Merge pull request #43 from ceph/fix_locking

Fix lock_many race condition