Merge "Cleanup patch for the cell-disable series"

This commit is contained in:
Zuul 2018-05-03 10:58:38 +00:00 committed by Gerrit Code Review
commit 7e25f50cbf
2 changed files with 31 additions and 21 deletions

View File

@ -195,12 +195,16 @@ Nova Cells v2
one defined by ``[database]/connection`` in the configuration file passed one defined by ``[database]/connection`` in the configuration file passed
to nova-manage. If a transport_url is not specified, it will use the one to nova-manage. If a transport_url is not specified, it will use the one
defined by ``[DEFAULT]/transport_url`` in the configuration file. The defined by ``[DEFAULT]/transport_url`` in the configuration file. The
verbose option will print out the resulting cell mapping uuid. Returns 0 verbose option will print out the resulting cell mapping uuid. All the
if the cell mapping was successfully created, 1 if the transport url or cells created are by default enabled. However passing the ``--disabled`` option
database connection was missing, and 2 if a cell is already using that can create a pre-disabled cell, meaning no scheduling will happen to this
transport url and database connection combination. All the cells created are cell. The meaning of the various exit codes returned by this command are
by default enabled. However passing the disabled option can create a pre-disabled explained below:
cell, meaning no scheduling will happen to this cell.
* Returns 0 if the cell mapping was successfully created.
* Returns 1 if the transport url or database connection was missing.
* Returns 2 if another cell is already using that transport url and/or
database connection combination.
``nova-manage cell_v2 discover_hosts [--cell_uuid <cell_uuid>] [--verbose] [--strict] [--by-service]`` ``nova-manage cell_v2 discover_hosts [--cell_uuid <cell_uuid>] [--verbose] [--strict] [--by-service]``
Searches cells, or a single cell, and maps found hosts. This command will Searches cells, or a single cell, and maps found hosts. This command will
@ -244,14 +248,17 @@ Nova Cells v2
database_connection is not specified, it will attempt to use the one database_connection is not specified, it will attempt to use the one
defined by ``[database]/connection`` in the configuration file. If a defined by ``[database]/connection`` in the configuration file. If a
transport_url is not specified, it will attempt to use the one defined by transport_url is not specified, it will attempt to use the one defined by
``[DEFAULT]/transport_url`` in the configuration file. If the cell is not ``[DEFAULT]/transport_url`` in the configuration file. The meaning of the
found by uuid, this command will return an exit code of 1. If the provided various exit codes returned by this command are explained below:
transport_url or/and database_connection is/are same as another cell,
this command will return an exit code of 3. If the properties cannot be set, * If successful, it will return 0.
this will return 2. If an attempt is made to disable and enable a cell at the * If the cell is not found by the provided uuid, it will return 1.
same time, this command will return an exit code of 4. If an attempt is made * If the properties cannot be set, it will return 2.
to disable or enable cell0 this command will return an exit code of 5. * If the provided transport_url or/and database_connection is/are same as
Otherwise, the exit code will be 0. another cell, it will return 3.
* If an attempt is made to disable and enable a cell at the same time, it
will return 4.
* If an attempt is made to disable or enable cell0 it will return 5.
.. note:: .. note::

View File

@ -119,11 +119,14 @@ class _TestCellMappingObject(object):
def test_obj_make_compatible(self): def test_obj_make_compatible(self):
cell_mapping_obj = cell_mapping.CellMapping(context=self.context) cell_mapping_obj = cell_mapping.CellMapping(context=self.context)
fake_cell_mapping_copy = dict(get_db_mapping()) fake_cell_mapping_obj = cell_mapping.CellMapping(context=self.context,
self.assertIn('disabled', fake_cell_mapping_copy) uuid=uuids.cell,
cell_mapping_obj.obj_make_compatible(fake_cell_mapping_copy, '1.0') disabled=False)
self.assertIn('uuid', fake_cell_mapping_copy) obj_primitive = fake_cell_mapping_obj.obj_to_primitive('1.0')
self.assertNotIn('disabled', fake_cell_mapping_copy) obj = cell_mapping_obj.obj_from_primitive(obj_primitive)
self.assertIn('uuid', obj)
self.assertEqual(uuids.cell, obj.uuid)
self.assertNotIn('disabled', obj)
class TestCellMappingObject(test_objects._LocalTest, class TestCellMappingObject(test_objects._LocalTest,