Add racefree way to add a new unique data point
authorSimo Sorce <simo@redhat.com>
Fri, 4 Apr 2014 14:34:21 +0000 (10:34 -0400)
committerSimo Sorce <simo@redhat.com>
Fri, 4 Apr 2014 16:38:41 +0000 (12:38 -0400)
commitc67d1a3583a6eda8c626c6d1d9cb42547d7a5b68
tree50b2b9ca2dca9f4b5f15efd4b6c7afdafdab9e23
parent5a6c713fda1a4052051566984c0b489e286aa502
Add racefree way to add a new unique data point

Our schema gathers together data related to a service by using an ID
column. This column cannot be unique or a primary key as the ID is
repeated for each key/value pair in the datum group.

Use a unique identifier to make sure we can let dqlite generate a new
ID internally and then find out wat it is as race-free as possible.

We keep this method in the data module so it can be changed later
without affecting application logic.

Signed-off-by: Simo Sorce <simo@redhat.com>
ipsilon/util/data.py
ipsilon/util/plugin.py