summaryrefslogtreecommitdiff
path: root/novaclient
diff options
context:
space:
mode:
authorTakashi NATSUME <natsume.takashi@lab.ntt.co.jp>2019-10-04 09:37:02 +0900
committerTakashi NATSUME <natsume.takashi@lab.ntt.co.jp>2019-10-04 10:09:31 +0900
commit364cad41912e2c0f99a30f78b2835f3480a18d6e (patch)
treede2a903a8948fc3ff2325997c0c2df5ef9abdb58 /novaclient
parent48634ed51e64f10424eef5bfb18dc63eda051c1d (diff)
downloadpython-novaclient-364cad41912e2c0f99a30f78b2835f3480a18d6e.tar.gz
Remove cells v1 and extension commands and APIs
The following CLIs and their backing API bindings which have been deprecated since 20.0.0 Train release have now been removed. - list-extensions - cell-capacities - cell-show Change-Id: I8e6edf1e4c1bf12d51ed993363129b4f4c3aa36c
Diffstat (limited to 'novaclient')
-rw-r--r--novaclient/tests/functional/v2/legacy/test_readonly_nova.py7
-rw-r--r--novaclient/tests/unit/v2/fakes.py75
-rw-r--r--novaclient/tests/unit/v2/test_cells.py55
-rw-r--r--novaclient/tests/unit/v2/test_list_extensions.py41
-rw-r--r--novaclient/tests/unit/v2/test_shell.py24
-rw-r--r--novaclient/v2/cells.py56
-rw-r--r--novaclient/v2/client.py4
-rw-r--r--novaclient/v2/list_extensions.py50
-rw-r--r--novaclient/v2/shell.py54
9 files changed, 0 insertions, 366 deletions
diff --git a/novaclient/tests/functional/v2/legacy/test_readonly_nova.py b/novaclient/tests/functional/v2/legacy/test_readonly_nova.py
index 7f81e41a..ed002c50 100644
--- a/novaclient/tests/functional/v2/legacy/test_readonly_nova.py
+++ b/novaclient/tests/functional/v2/legacy/test_readonly_nova.py
@@ -85,13 +85,6 @@ class SimpleReadOnlyNovaClientTest(base.ClientTestBase):
def test_admin_help(self):
self.nova('help')
- def test_admin_list_extensions(self):
- output = self.nova('list-extensions', merge_stderr=True)
- self.assertIn(
- 'The API extension interface has been deprecated. This command '
- 'will be removed in the first major release after '
- 'the Nova server 20.0.0 Train release.', output)
-
def test_agent_list(self):
self.nova('agent-list')
self.nova('agent-list', flags='--debug')
diff --git a/novaclient/tests/unit/v2/fakes.py b/novaclient/tests/unit/v2/fakes.py
index dd60d7f4..3430679b 100644
--- a/novaclient/tests/unit/v2/fakes.py
+++ b/novaclient/tests/unit/v2/fakes.py
@@ -329,53 +329,6 @@ class FakeSessionClient(base_client.SessionClient):
'id': 1}})
#
- # List all extensions
- #
-
- def get_extensions(self, **kw):
- exts = [
- {
- "alias": "NMN",
- "description": "Multiple network support",
- "links": [],
- "name": "Multinic",
- "namespace": ("http://docs.openstack.org/"
- "compute/ext/multinic/api/v1.1"),
- "updated": "2011-06-09T00:00:00+00:00"
- },
- {
- "alias": "OS-DCF",
- "description": "Disk Management Extension",
- "links": [],
- "name": "DiskConfig",
- "namespace": ("http://docs.openstack.org/"
- "compute/ext/disk_config/api/v1.1"),
- "updated": "2011-09-27T00:00:00+00:00"
- },
- {
- "alias": "OS-EXT-SRV-ATTR",
- "description": "Extended Server Attributes support.",
- "links": [],
- "name": "ExtendedServerAttributes",
- "namespace": ("http://docs.openstack.org/"
- "compute/ext/extended_status/api/v1.1"),
- "updated": "2011-11-03T00:00:00+00:00"
- },
- {
- "alias": "OS-EXT-STS",
- "description": "Extended Status support",
- "links": [],
- "name": "ExtendedStatus",
- "namespace": ("http://docs.openstack.org/"
- "compute/ext/extended_status/api/v1.1"),
- "updated": "2011-11-03T00:00:00+00:00"
- },
- ]
- return (200, FAKE_RESPONSE_HEADERS, {
- "extensions": exts,
- })
-
- #
# Limits
#
@@ -2296,34 +2249,6 @@ class FakeSessionClient(base_client.SessionClient):
def post_servers_uuid6_action(self, **kw):
return 202, {}, {}
- def get_os_cells_child_cell(self, **kw):
- cell = {'cell': {
- 'username': 'cell1_user',
- 'name': 'cell1',
- 'rpc_host': '10.0.1.10',
- 'info': {
- 'username': 'cell1_user',
- 'rpc_host': '10.0.1.10',
- 'type': 'child',
- 'name': 'cell1',
- 'rpc_port': 5673},
- 'type': 'child',
- 'rpc_port': 5673,
- 'loaded': True
- }}
- return (200, FAKE_RESPONSE_HEADERS, cell)
-
- def get_os_cells_capacities(self, **kw):
- cell_capacities_response = {"cell": {"capacities": {"ram_free": {
- "units_by_mb": {"8192": 0, "512": 13, "4096": 1, "2048": 3,
- "16384": 0}, "total_mb": 7680}, "disk_free": {
- "units_by_mb": {"81920": 11, "20480": 46, "40960": 23, "163840": 5,
- "0": 0}, "total_mb": 1052672}}}}
- return (200, FAKE_RESPONSE_HEADERS, cell_capacities_response)
-
- def get_os_cells_child_cell_capacities(self, **kw):
- return self.get_os_cells_capacities()
-
def get_os_migrations(self, **kw):
migration1 = {
"created_at": "2012-10-29T13:42:02.000000",
diff --git a/novaclient/tests/unit/v2/test_cells.py b/novaclient/tests/unit/v2/test_cells.py
deleted file mode 100644
index ff898f53..00000000
--- a/novaclient/tests/unit/v2/test_cells.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright 2013 Rackspace Hosting
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# 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
-
-CELL_V1_DEPRECATION_WARNING = (
- 'The cells v1 interface has been deprecated in Nova since 16.0.0 Pike '
- 'Release. This API binding will be removed in the first major release '
- 'after the Nova server 20.0.0 Train release.')
-
-
-@mock.patch('warnings.warn')
-class CellsExtensionTests(utils.TestCase):
- def setUp(self):
- super(CellsExtensionTests, self).setUp()
- self.cs = fakes.FakeClient(api_versions.APIVersion("2.1"))
-
- def test_get_cells(self, mock_warn):
- cell_name = 'child_cell'
- cell = self.cs.cells.get(cell_name)
- self.assert_request_id(cell, fakes.FAKE_REQUEST_ID_LIST)
- self.cs.assert_called('GET', '/os-cells/%s' % cell_name)
- mock_warn.assert_called_once_with(CELL_V1_DEPRECATION_WARNING,
- DeprecationWarning)
-
- def test_get_capacities_for_a_given_cell(self, mock_warn):
- cell_name = 'child_cell'
- ca = self.cs.cells.capacities(cell_name)
- self.assert_request_id(ca, fakes.FAKE_REQUEST_ID_LIST)
- self.cs.assert_called('GET', '/os-cells/%s/capacities' % cell_name)
- mock_warn.assert_called_once_with(CELL_V1_DEPRECATION_WARNING,
- DeprecationWarning)
-
- def test_get_capacities_for_all_cells(self, mock_warn):
- ca = self.cs.cells.capacities()
- self.assert_request_id(ca, fakes.FAKE_REQUEST_ID_LIST)
- self.cs.assert_called('GET', '/os-cells/capacities')
- mock_warn.assert_called_once_with(CELL_V1_DEPRECATION_WARNING,
- DeprecationWarning)
diff --git a/novaclient/tests/unit/v2/test_list_extensions.py b/novaclient/tests/unit/v2/test_list_extensions.py
deleted file mode 100644
index de299cd0..00000000
--- a/novaclient/tests/unit/v2/test_list_extensions.py
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# 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
-
-
-class ListExtensionsTests(utils.TestCase):
- def setUp(self):
- super(ListExtensionsTests, self).setUp()
- self.cs = fakes.FakeClient(api_versions.APIVersion("2.1"))
-
- @mock.patch('warnings.warn')
- def test_list_extensions(self, mock_warn):
- all_exts = self.cs.list_extensions.show_all()
- self.assert_request_id(all_exts, fakes.FAKE_REQUEST_ID_LIST)
- self.cs.assert_called('GET', '/extensions')
- self.assertGreater(len(all_exts), 0)
- warning_message = (
- 'The API extension interface has been deprecated since 12.0.0 '
- 'Liberty Release. This API binding will be removed in the first '
- 'major release after the Nova server 20.0.0 Train release.')
- mock_warn.assert_called_once_with(warning_message, DeprecationWarning)
- for r in all_exts:
- mock_warn.reset_mock()
- self.assertGreater(len(r.summary), 0)
- mock_warn.assert_called_once_with(warning_message,
- DeprecationWarning)
diff --git a/novaclient/tests/unit/v2/test_shell.py b/novaclient/tests/unit/v2/test_shell.py
index 48b77b22..06b27ad3 100644
--- a/novaclient/tests/unit/v2/test_shell.py
+++ b/novaclient/tests/unit/v2/test_shell.py
@@ -3992,30 +3992,6 @@ class ShellTest(utils.TestCase):
self.assert_called('GET', '/os-instance_usage_audit_log'
'/2016-12-10%2013%3A59%3A59.999999')
- def test_cell_show(self):
- _, err = self.run_command('cell-show child_cell')
- self.assert_called('GET', '/os-cells/child_cell')
- self.assertIn(
- 'The cells v1 interface has been deprecated. This command will be '
- 'removed in the first major release after the Nova server 20.0.0 '
- 'Train release.', err)
-
- def test_cell_capacities_with_cell_name(self):
- _, err = self.run_command('cell-capacities --cell child_cell')
- self.assert_called('GET', '/os-cells/child_cell/capacities')
- self.assertIn(
- 'The cells v1 interface has been deprecated. This command will be '
- 'removed in the first major release after the Nova server 20.0.0 '
- 'Train release.', err)
-
- def test_cell_capacities_without_cell_name(self):
- _, err = self.run_command('cell-capacities')
- self.assert_called('GET', '/os-cells/capacities')
- self.assertIn(
- 'The cells v1 interface has been deprecated. This command will be '
- 'removed in the first major release after the Nova server 20.0.0 '
- 'Train release.', err)
-
def test_migration_list(self):
self.run_command('migration-list')
self.assert_called('GET', '/os-migrations')
diff --git a/novaclient/v2/cells.py b/novaclient/v2/cells.py
deleted file mode 100644
index 44cadddb..00000000
--- a/novaclient/v2/cells.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright 2013 Rackspace Hosting
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-import warnings
-
-from novaclient import base
-from novaclient.i18n import _
-
-CELL_V1_DEPRECATION_WARNING = _(
- 'The cells v1 interface has been deprecated in Nova since 16.0.0 Pike '
- 'Release. This API binding will be removed in the first major release '
- 'after the Nova server 20.0.0 Train release.')
-
-
-class Cell(base.Resource):
- """DEPRECATED"""
- def __repr__(self):
- return "<Cell: %s>" % self.name
-
-
-class CellsManager(base.Manager):
- """DEPRECATED"""
- resource_class = Cell
-
- def get(self, cell_name):
- """
- DEPRECATED Get a cell.
-
- :param cell_name: Name of the :class:`Cell` to get.
- :rtype: :class:`Cell`
- """
- warnings.warn(CELL_V1_DEPRECATION_WARNING, DeprecationWarning)
- return self._get("/os-cells/%s" % cell_name, "cell")
-
- def capacities(self, cell_name=None):
- """
- DEPRECATED Get capacities for a cell.
-
- :param cell_name: Name of the :class:`Cell` to get capacities for.
- :rtype: :class:`Cell`
- """
- warnings.warn(CELL_V1_DEPRECATION_WARNING, DeprecationWarning)
- path = ["%s/capacities" % cell_name, "capacities"][cell_name is None]
- return self._get("/os-cells/%s" % path, "cell")
diff --git a/novaclient/v2/client.py b/novaclient/v2/client.py
index cec9f2f6..dc170116 100644
--- a/novaclient/v2/client.py
+++ b/novaclient/v2/client.py
@@ -22,7 +22,6 @@ from novaclient.v2 import agents
from novaclient.v2 import aggregates
from novaclient.v2 import assisted_volume_snapshots
from novaclient.v2 import availability_zones
-from novaclient.v2 import cells
from novaclient.v2 import flavor_access
from novaclient.v2 import flavors
from novaclient.v2 import hypervisors
@@ -31,7 +30,6 @@ from novaclient.v2 import instance_action
from novaclient.v2 import instance_usage_audit_log
from novaclient.v2 import keypairs
from novaclient.v2 import limits
-from novaclient.v2 import list_extensions
from novaclient.v2 import migrations
from novaclient.v2 import networks
from novaclient.v2 import quota_classes
@@ -167,11 +165,9 @@ class Client(object):
# deprecated now, which is why it is not initialized by default.
self.assisted_volume_snapshots = \
assisted_volume_snapshots.AssistedSnapshotManager(self)
- self.cells = cells.CellsManager(self)
self.instance_action = instance_action.InstanceActionManager(self)
self.instance_usage_audit_log = \
instance_usage_audit_log.InstanceUsageAuditLogManager(self)
- self.list_extensions = list_extensions.ListExtManager(self)
self.migrations = migrations.MigrationManager(self)
self.server_external_events = \
server_external_events.ServerExternalEventManager(self)
diff --git a/novaclient/v2/list_extensions.py b/novaclient/v2/list_extensions.py
deleted file mode 100644
index e7043e31..00000000
--- a/novaclient/v2/list_extensions.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright 2011 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-import warnings
-
-from novaclient import base
-from novaclient.i18n import _
-
-EXTENSION_DEPRECATION_WARNING = _(
- 'The API extension interface has been deprecated since 12.0.0 Liberty '
- 'Release. This API binding will be removed in the first major release '
- 'after the Nova server 20.0.0 Train release.')
-
-
-class ListExtResource(base.Resource):
- """DEPRECATED"""
- @property
- def summary(self):
- """DEPRECATED"""
- warnings.warn(EXTENSION_DEPRECATION_WARNING, DeprecationWarning)
- descr = self.description.strip()
- if not descr:
- return '??'
- lines = descr.split("\n")
- if len(lines) == 1:
- return lines[0]
- else:
- return lines[0] + "..."
-
-
-class ListExtManager(base.Manager):
- """DEPRECATED"""
- resource_class = ListExtResource
-
- def show_all(self):
- """DEPRECATED"""
- warnings.warn(EXTENSION_DEPRECATION_WARNING, DeprecationWarning)
- return self._list("/extensions", 'extensions')
diff --git a/novaclient/v2/shell.py b/novaclient/v2/shell.py
index 772942e9..3d7ba896 100644
--- a/novaclient/v2/shell.py
+++ b/novaclient/v2/shell.py
@@ -48,21 +48,6 @@ from novaclient.v2 import servers
logger = logging.getLogger(__name__)
-CELL_V1_DEPRECATION_WARNING = _(
- 'The cells v1 interface has been deprecated. This command will be removed '
- 'in the first major release after the Nova server 20.0.0 Train release.')
-
-EXTENSION_DEPRECATION_WARNING = _(
- 'The API extension interface has been deprecated. This command will be '
- 'removed in the first major release after the Nova server 20.0.0 Train '
- 'release.')
-
-
-# NOTE(takashin): Remove this along with the deprecated commands in the first
-# major python-novaclient release AFTER the nova server 20.0.0 Train release.
-def _emit_deprecation_warning(message):
- print(message, file=sys.stderr)
-
def emit_duplicated_image_with_warning(img, image_with):
img_uuid_list = [str(image.id) for image in img]
@@ -4928,35 +4913,6 @@ def do_server_tag_delete_all(cs, args):
server.delete_all_tags()
-@utils.arg(
- 'cell',
- metavar='<cell-name>',
- help=_('Name of the cell.'))
-def do_cell_show(cs, args):
- """DEPRECATED Show details of a given cell."""
- _emit_deprecation_warning(CELL_V1_DEPRECATION_WARNING)
- cell = cs.cells.get(args.cell)
- utils.print_dict(cell.to_dict())
-
-
-@utils.arg(
- '--cell',
- metavar='<cell-name>',
- help=_("Name of the cell to get the capacities."),
- default=None)
-def do_cell_capacities(cs, args):
- """DEPRECATED Get cell capacities for all cells or a given cell."""
- _emit_deprecation_warning(CELL_V1_DEPRECATION_WARNING)
- cell = cs.cells.capacities(args.cell)
- print(_("Ram Available: %s MiB") % cell.capacities['ram_free']['total_mb'])
- utils.print_dict(cell.capacities['ram_free']['units_by_mb'],
- dict_property='Ram(MiB)', dict_value="Units")
- print(_("\nDisk Available: %s MiB") %
- cell.capacities['disk_free']['total_mb'])
- utils.print_dict(cell.capacities['disk_free']['units_by_mb'],
- dict_property='Disk(MiB)', dict_value="Units")
-
-
@utils.arg('server', metavar='<server>', help='Name or ID of server.')
def do_force_delete(cs, args):
"""Force delete a server."""
@@ -5378,16 +5334,6 @@ def do_instance_action_list(cs, args):
sortby_index=3)
-def do_list_extensions(cs, _args):
- """
- DEPRECATED List all the os-api extensions that are available.
- """
- _emit_deprecation_warning(EXTENSION_DEPRECATION_WARNING)
- extensions = cs.list_extensions.show_all()
- fields = ["Name", "Summary", "Alias", "Updated"]
- utils.print_list(extensions, fields)
-
-
@utils.arg('host', metavar='<host>',
help='The hypervisor hostname (or pattern) to search for. '
'WARNING: Use a fully qualified domain name if you only '