Remove deprecated MigrationManager.list cell_name kwarg

The cell_name kwarg was deprecated in Pike:

I54468682d5391668a513e708e26bc3c165c95ca1

And the CLI option was removed earlier in Queens (not yet
released):

I5d11eda2a6b35de98f0484492f597a87df882013

But that change forgot about the python API binding code
so this change removes that as well and updates the release
note.

Change-Id: I0cf808eaf7df80e221b412d2374b81fd402bd037
Closes-Bug: #1668743
This commit is contained in:
Matt Riedemann 2018-01-11 15:59:16 -05:00
parent b91ca62aea
commit 40bf060233
4 changed files with 9 additions and 27 deletions

View File

@ -10,8 +10,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from novaclient import api_versions
from novaclient.tests.unit import utils
from novaclient.tests.unit.v2 import fakes
@ -40,33 +38,23 @@ class MigrationsTest(utils.TestCase):
self.assertIsInstance(m, migrations.Migration)
self.assertEqual(m.migration_type, 'live-migration')
@mock.patch('novaclient.v2.migrations.warnings.warn')
def test_list_migrations_with_cell_name(self, mock_warn):
ml = self.cs.migrations.list(cell_name="abc")
self.assert_request_id(ml, fakes.FAKE_REQUEST_ID_LIST)
self.cs.assert_called('GET', '/os-migrations?cell_name=abc')
for m in ml:
self.assertIsInstance(m, migrations.Migration)
self.assertTrue(mock_warn.called)
def test_list_migrations_with_filters(self):
ml = self.cs.migrations.list('host1', 'finished', 'child1')
ml = self.cs.migrations.list('host1', 'finished')
self.assert_request_id(ml, fakes.FAKE_REQUEST_ID_LIST)
self.cs.assert_called(
'GET',
'/os-migrations?cell_name=child1&host=host1&status=finished')
'/os-migrations?host=host1&status=finished')
for m in ml:
self.assertIsInstance(m, migrations.Migration)
def test_list_migrations_with_instance_uuid_filter(self):
ml = self.cs.migrations.list('host1', 'finished', 'child1',
'instance_id_456')
ml = self.cs.migrations.list('host1', 'finished', 'instance_id_456')
self.assert_request_id(ml, fakes.FAKE_REQUEST_ID_LIST)
self.cs.assert_called(
'GET',
('/os-migrations?cell_name=child1&host=host1&'
('/os-migrations?host=host1&'
'instance_uuid=instance_id_456&status=finished'))
self.assertEqual(1, len(ml))
self.assertEqual('instance_id_456', ml[0].instance_uuid)

View File

@ -15,9 +15,6 @@ migration interface
"""
from novaclient import base
from novaclient.i18n import _
import warnings
class Migration(base.Resource):
@ -28,23 +25,17 @@ class Migration(base.Resource):
class MigrationManager(base.ManagerWithFind):
resource_class = Migration
def list(self, host=None, status=None, cell_name=None, instance_uuid=None):
def list(self, host=None, status=None, instance_uuid=None):
"""
Get a list of migrations.
:param host: (optional) filter migrations by host name.
:param status: (optional) filter migrations by status.
:param cell_name: (optional) filter migrations for a cell.
"""
opts = {}
if host:
opts['host'] = host
if status:
opts['status'] = status
if cell_name:
warnings.warn(_("Argument 'cell_name' is "
"deprecated since Pike, and will "
"be removed in a future release."))
opts['cell_name'] = cell_name
if instance_uuid:
opts['instance_uuid'] = instance_uuid

View File

@ -5212,6 +5212,6 @@ def _print_migrations(cs, migrations):
help=_('Fetch migrations for the given status.'))
def do_migration_list(cs, args):
"""Print a list of migrations."""
migrations = cs.migrations.list(args.host, args.status, None,
migrations = cs.migrations.list(args.host, args.status,
instance_uuid=args.instance_uuid)
_print_migrations(cs, migrations)

View File

@ -6,3 +6,6 @@ upgrade:
- ``--tenant`` (from ``flavor access list``)
- ``--cell_name`` (from ``migration list``)
- ``--volume-service-name`` (global option)
As a result, the ``novaclient.v2.migrations.MigrationManager.list``
python API binding method no longer takes a ``cell_name`` kwarg.