Merge "set disk field to disk capacity"
This commit is contained in:
@@ -356,7 +356,12 @@ class NovaModelBuilder(base.BaseModelBuilder):
|
||||
"memory_ratio": memory_ratio,
|
||||
"memory_mb_reserved": memory_mb_reserved,
|
||||
"memory_mb_used": memory_used,
|
||||
"disk": node.free_disk_gb,
|
||||
# The node.free_disk_gb does not take allocation ratios used
|
||||
# for overcommit into account so this value may be negative.
|
||||
# We do not need this field and plan to set disk to total disk
|
||||
# capacity and then remove disk_capacity.
|
||||
"disk": disk_capacity,
|
||||
# TODO(licanwei): remove and replace by disk field
|
||||
"disk_capacity": disk_capacity,
|
||||
"disk_gb_used": disk_used,
|
||||
"disk_gb_reserved": disk_gb_reserved,
|
||||
|
||||
@@ -133,7 +133,12 @@ class NovaNotification(base.NotificationEndpoint):
|
||||
status=_node.status,
|
||||
memory=_node.memory_mb,
|
||||
vcpus=_node.vcpus,
|
||||
disk=_node.free_disk_gb,
|
||||
# The node.free_disk_gb does not take allocation ratios used
|
||||
# for overcommit into account so this value may be negative.
|
||||
# We do not need this field and plan to set disk to total disk
|
||||
# capacity and then remove disk_capacity.
|
||||
disk=_node.local_gb,
|
||||
# TODO(licanwei): remove and replace by disk field
|
||||
disk_capacity=_node.local_gb,
|
||||
)
|
||||
self.cluster_data_model.add_node(node)
|
||||
|
||||
@@ -313,7 +313,7 @@ class TestNovaNotifications(NotificationTestCase):
|
||||
node_2 = compute_model.get_node_by_name('Node_2')
|
||||
self.assertEqual(7777, node_2.memory)
|
||||
self.assertEqual(42, node_2.vcpus)
|
||||
self.assertEqual(974, node_2.disk)
|
||||
self.assertEqual(1337, node_2.disk)
|
||||
self.assertEqual(1337, node_2.disk_capacity)
|
||||
|
||||
@mock.patch.object(nova_helper, "NovaHelper")
|
||||
|
||||
Reference in New Issue
Block a user