From 4a17f69d7f711c900868e699b4e2f3be3e0c28f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Suchomel?= Date: Mon, 22 Jan 2018 12:19:18 +0100 Subject: [PATCH] Do not multiply megabytes with 1024 to get gigabytes. The tests were actually not failing, since the value of reserved_host_disk_mb is set to 0 by default. Still, let's adapt confusing lines. Change-Id: I686fd2e7aa3973c689ee8320a777c9845adfda46 --- nova/tests/unit/scheduler/client/test_report.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nova/tests/unit/scheduler/client/test_report.py b/nova/tests/unit/scheduler/client/test_report.py index 3b1d9c389c7f..9baba3320390 100644 --- a/nova/tests/unit/scheduler/client/test_report.py +++ b/nova/tests/unit/scheduler/client/test_report.py @@ -2666,7 +2666,7 @@ There was a conflict when trying to complete your request. }, 'DISK_GB': { 'total': 10, - 'reserved': CONF.reserved_host_disk_mb * 1024, + 'reserved': 0, # reserved_host_disk_mb is 0 by default 'min_unit': 1, 'max_unit': compute_node.local_gb, 'step_size': 1, @@ -2681,6 +2681,8 @@ There was a conflict when trying to complete your request. @mock.patch('nova.scheduler.client.report.SchedulerReportClient.' 'put') def test_update_inventory(self, mock_put, mock_get): + self.flags(reserved_host_disk_mb=1000) + # Ensure _update_inventory() returns a list of Inventories objects # after creating or updating the existing values uuid = uuids.compute_node @@ -2742,7 +2744,7 @@ There was a conflict when trying to complete your request. }, 'DISK_GB': { 'total': 10, - 'reserved': CONF.reserved_host_disk_mb * 1024, + 'reserved': 1, # this is ceil for 1000MB 'min_unit': 1, 'max_unit': compute_node.local_gb, 'step_size': 1, @@ -2787,7 +2789,7 @@ There was a conflict when trying to complete your request. }, 'DISK_GB': { 'total': 10, - 'reserved': CONF.reserved_host_disk_mb * 1024, + 'reserved': 0, 'min_unit': 1, 'max_unit': compute_node.local_gb, 'step_size': 1,