def create_id(uuid):
    with redis.pipeline() as pipe:
        while True:
            try:
                pipe.watch(KEY_LAST_ID)
                current_id = pipe.get(KEY_LAST_ID) or 0
                next_id = int(current_id) + 1
                pipe.multi()
                pipe.set(KEY_LAST_ID, next_id)
                pipe.execute()

                redis.set('{}:{}'.format(KEY_PREFIX, uuid), next_id)
                return next_id
            except WatchError:
                continue
            except:
                raise
Cleanup OpenStack deployment.
dataset/ETHPy150Open Crystalnix/omaha-server/omaha_server/omaha/utils.py/create_id--crossover with--dataset/ETHPy150Open openstack/rally/rally/deployment/engine.py/Engine.cleanup