From 8ab3300d5d588f169b40ca7dbc6cd63370226066 Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Tue, 2 Apr 2019 15:07:45 +0100 Subject: [PATCH] Don't report 'exiting' when mapping cells When running 'nova-manage simple_cell_setup...' if there are not hosts to map, but there remaining instances to map, an '..., exiting' message is produced. This is misleading because "exiting" implies a return of control to the user. That doesn't happen if there are many instances left to inspect or map. This change gets around that by getting rid of the exiting message in the case where instance mapping can still happen. Change-Id: I62b20a3676429b5cc756884275138566785b347e Closes-Bug: #1821737 --- nova/cmd/manage.py | 2 +- nova/tests/unit/test_nova_manage.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/cmd/manage.py b/nova/cmd/manage.py index dc28cf45ef..b9836160c5 100644 --- a/nova/cmd/manage.py +++ b/nova/cmd/manage.py @@ -1332,7 +1332,7 @@ class CellV2Commands(object): # we should support. cell_mapping_uuid = host_mapping.cell_mapping.uuid if not missing_nodes: - print(_('All hosts are already mapped to cell(s), exiting.')) + print(_('All hosts are already mapped to cell(s).')) return cell_mapping_uuid # Create the cell mapping in the API database if cell_mapping_uuid is not None: diff --git a/nova/tests/unit/test_nova_manage.py b/nova/tests/unit/test_nova_manage.py index 3819b6b6c7..a437f26820 100644 --- a/nova/tests/unit/test_nova_manage.py +++ b/nova/tests/unit/test_nova_manage.py @@ -1103,7 +1103,7 @@ class CellV2CommandsTestCase(test.NoDBTestCase): for i in range(3): expected += ('Host host%s is already mapped to cell %s\n' % (i, cell_mapping_uuid)) - expected += 'All hosts are already mapped to cell(s), exiting.' + expected += 'All hosts are already mapped to cell(s).' self.assertEqual(expected, output) def test_map_cell_and_hosts_partial_update(self):