Merge "Update storage CDM collector"

This commit is contained in:
Zuul
2018-06-06 12:16:43 +00:00
committed by Gerrit Code Review
3 changed files with 66 additions and 0 deletions

View File

@@ -222,8 +222,21 @@ class ModelBuilder(object):
:param pool: A storage pool
:type pool: :py:class:`~cinderlient.v2.capabilities.Capabilities`
:raises: exception.InvalidPoolAttributeValue
"""
# build up the storage pool.
attrs = ["total_volumes", "total_capacity_gb",
"free_capacity_gb", "provisioned_capacity_gb",
"allocated_capacity_gb"]
for attr in attrs:
try:
int(getattr(pool, attr))
except ValueError:
raise exception.InvalidPoolAttributeValue(
name=pool.name, attribute=attr)
node_attributes = {
"name": pool.name,
"total_volumes": pool.total_volumes,