From 8a9bae52169a8b824188863b3ce0433cd67b49cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=A2n=20L=C3=AA?= <16718453+moly7x@users.noreply.github.com> Date: Fri, 22 Oct 2021 11:38:50 +0700 Subject: [PATCH] FIX ERROR cinder.volume.drivers.vitastor KeyError: 'total_raw_tb' --- patches/cinder-vitastor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/cinder-vitastor.py b/patches/cinder-vitastor.py index bb7e9f1d..4eb29d38 100644 --- a/patches/cinder-vitastor.py +++ b/patches/cinder-vitastor.py @@ -266,7 +266,7 @@ class VitastorDriver(driver.CloneableImageVD, stats['provisioned_capacity_gb'] = round(total_provisioned/1024.0/1024.0/1024.0, 2) pool_stats = pool_stats['responses'][0]['kvs'] 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['total_capacity_gb'] = round(1024.0*pool_stats['total_raw_tb'], 2) stats['backend_state'] = 'up'