def _update_allocated_capacity(self, vol):
    pool = vol_utils.extract_host(vol['host'], 'pool')
    if (pool is None):
        pool = (self.driver.configuration.safe_get('volume_backend_name') or vol_utils.extract_host(vol['host'], 'pool', True))
    try:
        self.stats['pools'][pool]['allocated_capacity_gb'] += vol['size']
    except KeyError:
        self.stats['pools'][pool] = dict(allocated_capacity_gb=vol['size'])
def _update_allocated_capacity(self, vol):
    pool = vol_utils.extract_host(vol['host'], 'pool')
    if (pool is None):
        pool = (self.driver.configuration.safe_get('volume_backend_name') or vol_utils.extract_host(vol['host'], 'pool', True))
    try:
        self.stats['pools'][pool]['allocated_capacity_gb'] += vol['size']
    except KeyError:
        self.stats['pools'][pool] = dict(allocated_capacity_gb=vol['size'])