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.
On Thu, Feb 7, 2013 at 6:11 PM, Brian Murray <email address hidden> wrote: bucket_ systems( config, bucket, system): pool(config) ColumnFamily( pool, 'BucketSystems') cf.get( bucket) cf.insert( bucket, {system: ''}) cf.insert( bucket, {system: ''})
> +def update_
> + pool = connection_
> + bucketsystems_cf = pycassa.
> + try:
> + systems = bucketsystems_
> + if system not in systems:
> + bucketsystems_
> + except NotFoundException:
> + bucketsystems_
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.