Revision ffa7f6f6 snf-cyclades-app/synnefo/logic/rapi_pool.py

b/snf-cyclades-app/synnefo/logic/rapi_pool.py
38 38
log = getLogger(__name__)
39 39

  
40 40
_pools = {}
41
_hashes = {}
41 42
pool_size = 8
42 43

  
43 44

  
......
80 81
        log.debug("GET: No Pool. Creating new for host %s", host)
81 82
        pool = GanetiRapiClientPool(host, port, user, passwd, pool_size)
82 83
        _pools[backend_hash] = pool
83
        # TODO: Delete Pool for old backend_hash
84
        # Delete Pool for old backend_hash
85
        if backend_id in _hashes:
86
            del _pools[_hashes[backend_id]]
87
        _hashes[backend_id] = backend_hash
84 88

  
85 89
    obj = _pools[backend_hash].pool_get()
86 90
    log.debug("GET: Got object %r from pool", obj)

Also available in: Unified diff