Merge pull request #26 from moly7x/fix

FIX ERROR cinder.volume.drivers.vitastor KeyError: 'total_raw_tb'
nbd-vmsplice
Vitaliy Filippov 2021-10-22 21:29:52 +03:00 committed by GitHub
commit ef645ee0c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -266,7 +266,7 @@ class VitastorDriver(driver.CloneableImageVD,
stats['provisioned_capacity_gb'] = round(total_provisioned/1024.0/1024.0/1024.0, 2) stats['provisioned_capacity_gb'] = round(total_provisioned/1024.0/1024.0/1024.0, 2)
pool_stats = pool_stats['responses'][0]['kvs'] pool_stats = pool_stats['responses'][0]['kvs']
if len(pool_stats): if len(pool_stats):
pool_stats = pool_stats[0] pool_stats = pool_stats[0]['value']
stats['free_capacity_gb'] = round(1024.0*(pool_stats['total_raw_tb']-pool_stats['used_raw_tb'])/pool_stats['raw_to_usable'], 2) stats['free_capacity_gb'] = round(1024.0*(pool_stats['total_raw_tb']-pool_stats['used_raw_tb'])/pool_stats['raw_to_usable'], 2)
stats['total_capacity_gb'] = round(1024.0*pool_stats['total_raw_tb'], 2) stats['total_capacity_gb'] = round(1024.0*pool_stats['total_raw_tb'], 2)
stats['backend_state'] = 'up' stats['backend_state'] = 'up'