diff options
author | Takashi NATSUME <natsume.takashi@lab.ntt.co.jp> | 2019-10-04 09:37:02 +0900 |
---|---|---|
committer | Takashi NATSUME <natsume.takashi@lab.ntt.co.jp> | 2019-10-04 10:09:31 +0900 |
commit | 364cad41912e2c0f99a30f78b2835f3480a18d6e (patch) | |
tree | de2a903a8948fc3ff2325997c0c2df5ef9abdb58 /novaclient/v2 | |
parent | 48634ed51e64f10424eef5bfb18dc63eda051c1d (diff) | |
download | python-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/v2')
-rw-r--r-- | novaclient/v2/cells.py | 56 | ||||
-rw-r--r-- | novaclient/v2/client.py | 4 | ||||
-rw-r--r-- | novaclient/v2/list_extensions.py | 50 | ||||
-rw-r--r-- | novaclient/v2/shell.py | 54 |
4 files changed, 0 insertions, 164 deletions
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 ' |