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

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

View File

@ -119,11 +119,14 @@ class _TestCellMappingObject(object):
def test_obj_make_compatible(self):
cell_mapping_obj = cell_mapping.CellMapping(context=self.context)
fake_cell_mapping_copy = dict(get_db_mapping())
self.assertIn('disabled', fake_cell_mapping_copy)
cell_mapping_obj.obj_make_compatible(fake_cell_mapping_copy, '1.0')
self.assertIn('uuid', fake_cell_mapping_copy)
self.assertNotIn('disabled', fake_cell_mapping_copy)
fake_cell_mapping_obj = cell_mapping.CellMapping(context=self.context,
uuid=uuids.cell,
disabled=False)
obj_primitive = fake_cell_mapping_obj.obj_to_primitive('1.0')
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,