Code review comment for lp:~brian-murray/oops-repository/bucketsystems

Revision history for this message
Evan (ev) wrote :

On Thu, Feb 7, 2013 at 6:11 PM, Brian Murray <email address hidden> wrote:
> +def update_bucket_systems(config, bucket, system):
> + pool = connection_pool(config)
> + bucketsystems_cf = pycassa.ColumnFamily(pool, 'BucketSystems')
> + try:
> + systems = bucketsystems_cf.get(bucket)
> + if system not in systems:
> + bucketsystems_cf.insert(bucket, {system: ''})
> + except NotFoundException:
> + bucketsystems_cf.insert(bucket, {system: ''})

Shouldn't this just be bucketsystems_cf.insert() without the try block
or get() method? If there are already columns in bucketsystems_cf,
calling insert() will just update the column with that system
identifier.

« Back to merge proposal