Remove deprecated cloudpipe CLIs and python API bindings

These were all deprecated in the 9.0.0 release in Pike
via change I329ee0e5fcf068ea7e54b99fbaf94a524647f660
and we can remove them now. This will go into 10.0.0.

Change-Id: Ia90a49112847e365fcdaf581dc9ee32f9a20fd85
This commit is contained in:
Matt Riedemann 2018-01-11 16:31:45 -05:00
parent 4bc4078fcb
commit 8c73ba4471
8 changed files with 6 additions and 258 deletions

View File

@ -1,37 +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.
from novaclient.tests.unit.fixture_data import base
class Fixture(base.Fixture):
base_url = 'os-cloudpipe'
def setUp(self):
super(Fixture, self).setUp()
get_os_cloudpipe = {'cloudpipes': [{'project_id': 1}]}
self.requests_mock.get(self.url(),
json=get_os_cloudpipe,
headers=self.json_headers)
instance_id = '9d5824aa-20e6-4b9f-b967-76a699fc51fd'
post_os_cloudpipe = {'instance_id': instance_id}
self.requests_mock.post(self.url(),
json=post_os_cloudpipe,
headers=self.json_headers,
status_code=202)
self.requests_mock.put(self.url('configure-project'),
headers=self.json_headers,
status_code=202)

View File

@ -815,27 +815,6 @@ class FakeSessionClient(base_client.SessionClient):
def post_servers_5678_action(self, body, **kw): def post_servers_5678_action(self, body, **kw):
return self.post_servers_1234_action(body, **kw) return self.post_servers_1234_action(body, **kw)
#
# Cloudpipe
#
def get_os_cloudpipe(self, **kw):
return (
200,
{},
{'cloudpipes': [{'project_id': 1}]}
)
def post_os_cloudpipe(self, **ks):
return (
202,
{},
{'instance_id': '9d5824aa-20e6-4b9f-b967-76a699fc51fd'}
)
def put_os_cloudpipe_configure_project(self, **kw):
return (202, {}, None)
# #
# Flavors # Flavors
# #

View File

@ -1,57 +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
import six
from novaclient.tests.unit.fixture_data import client
from novaclient.tests.unit.fixture_data import cloudpipe as data
from novaclient.tests.unit import utils
from novaclient.tests.unit.v2 import fakes
from novaclient.v2 import cloudpipe
class CloudpipeTest(utils.FixturedTestCase):
data_fixture_class = data.Fixture
scenarios = [('original', {'client_fixture_class': client.V1}),
('session', {'client_fixture_class': client.SessionV1})]
@mock.patch('warnings.warn')
def test_list_cloudpipes(self, mock_warn):
cp = self.cs.cloudpipe.list()
self.assert_request_id(cp, fakes.FAKE_REQUEST_ID_LIST)
self.assert_called('GET', '/os-cloudpipe')
for c in cp:
self.assertIsInstance(c, cloudpipe.Cloudpipe)
mock_warn.assert_called_once_with(mock.ANY)
@mock.patch('warnings.warn')
def test_create(self, mock_warn):
project = "test"
cp = self.cs.cloudpipe.create(project)
self.assert_request_id(cp, fakes.FAKE_REQUEST_ID_LIST)
body = {'cloudpipe': {'project_id': project}}
self.assert_called('POST', '/os-cloudpipe', body)
self.assertIsInstance(cp, six.string_types)
mock_warn.assert_called_once_with(mock.ANY)
@mock.patch('warnings.warn')
def test_update(self, mock_warn):
cp = self.cs.cloudpipe.update("192.168.1.1", 2345)
self.assert_request_id(cp, fakes.FAKE_REQUEST_ID_LIST)
body = {'configure_project': {'vpn_ip': "192.168.1.1",
'vpn_port': 2345}}
self.assert_called('PUT', '/os-cloudpipe/configure-project', body)
mock_warn.assert_called_once_with(mock.ANY)

View File

@ -2768,21 +2768,6 @@ class ShellTest(utils.TestCase):
'PUT', '/os-quota-class-sets/97f4c221bff44578b0300df4ef119353', 'PUT', '/os-quota-class-sets/97f4c221bff44578b0300df4ef119353',
body) body)
def test_cloudpipe_list(self):
self.run_command('cloudpipe-list')
self.assert_called('GET', '/os-cloudpipe')
def test_cloudpipe_create(self):
self.run_command('cloudpipe-create myproject')
body = {'cloudpipe': {'project_id': "myproject"}}
self.assert_called('POST', '/os-cloudpipe', body)
def test_cloudpipe_configure(self):
self.run_command('cloudpipe-configure 192.168.1.1 1234')
body = {'configure_project': {'vpn_ip': "192.168.1.1",
'vpn_port': '1234'}}
self.assert_called('PUT', '/os-cloudpipe/configure-project', body)
def test_add_fixed_ip(self): def test_add_fixed_ip(self):
_, err = self.run_command('add-fixed-ip sample-server 1') _, err = self.run_command('add-fixed-ip sample-server 1')
self.assertIn('WARNING: Command add-fixed-ip is deprecated', err) self.assertIn('WARNING: Command add-fixed-ip is deprecated', err)

View File

@ -23,7 +23,6 @@ from novaclient.v2 import aggregates
from novaclient.v2 import assisted_volume_snapshots from novaclient.v2 import assisted_volume_snapshots
from novaclient.v2 import availability_zones from novaclient.v2 import availability_zones
from novaclient.v2 import cells from novaclient.v2 import cells
from novaclient.v2 import cloudpipe
from novaclient.v2 import contrib from novaclient.v2 import contrib
from novaclient.v2 import flavor_access from novaclient.v2 import flavor_access
from novaclient.v2 import flavors from novaclient.v2 import flavors
@ -148,7 +147,6 @@ class Client(object):
# extensions # extensions
self.agents = agents.AgentsManager(self) self.agents = agents.AgentsManager(self)
self.cloudpipe = cloudpipe.CloudpipeManager(self)
self.volumes = volumes.VolumeManager(self) self.volumes = volumes.VolumeManager(self)
self.keypairs = keypairs.KeypairManager(self) self.keypairs = keypairs.KeypairManager(self)
self.neutron = networks.NeutronManager(self) self.neutron = networks.NeutronManager(self)

View File

@ -1,88 +0,0 @@
# Copyright 2012 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.
"""DEPRECATED Cloudpipe interface."""
import warnings
from novaclient import base
from novaclient.i18n import _
DEPRECATION_WARNING = (
_('The os-cloudpipe Nova API has been removed. This API binding will be '
'removed in the first major release after the Nova server 16.0.0 Pike '
'release.')
)
class Cloudpipe(base.Resource):
"""A cloudpipe instance is a VPN attached to a project's VLAN."""
def __repr__(self):
return "<Cloudpipe: %s>" % self.project_id
def delete(self):
"""
DEPRECATED Delete the own cloudpipe instance
:returns: An instance of novaclient.base.TupleWithMeta
"""
warnings.warn(DEPRECATION_WARNING)
return self.manager.delete(self)
class CloudpipeManager(base.ManagerWithFind):
"""DEPRECATED"""
resource_class = Cloudpipe
def create(self, project):
"""DEPRECATED Launch a cloudpipe instance.
:param project: UUID of the project (tenant) for the cloudpipe
"""
warnings.warn(DEPRECATION_WARNING)
body = {'cloudpipe': {'project_id': project}}
return self._create('/os-cloudpipe', body, 'instance_id',
return_raw=True)
def list(self):
"""DEPRECATED Get a list of cloudpipe instances."""
warnings.warn(DEPRECATION_WARNING)
return self._list('/os-cloudpipe', 'cloudpipes')
def update(self, address, port):
"""DEPRECATED Configure cloudpipe parameters for the project.
Update VPN address and port for all networks associated
with the project defined by authentication
:param address: IP address
:param port: Port number
:returns: An instance of novaclient.base.TupleWithMeta
"""
warnings.warn(DEPRECATION_WARNING)
body = {'configure_project': {'vpn_ip': address,
'vpn_port': port}}
return self._update("/os-cloudpipe/configure-project", body)

View File

@ -48,12 +48,6 @@ from novaclient.v2 import servers
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
CLOUDPIPE_DEPRECATION_WARNING = (
_('The os-cloudpipe Nova API has been removed. This command will be '
'removed in the first major release after the Nova server 16.0.0 Pike '
'release.')
)
# NOTE(mriedem): Remove this along with the deprecated commands in the first # NOTE(mriedem): Remove this along with the deprecated commands in the first
# major python-novaclient release AFTER the nova server 16.0.0 Pike release. # major python-novaclient release AFTER the nova server 16.0.0 Pike release.
@ -923,38 +917,6 @@ def do_boot(cs, args):
_poll_for_status(cs.servers.get, server.id, 'building', ['active']) _poll_for_status(cs.servers.get, server.id, 'building', ['active'])
def do_cloudpipe_list(cs, _args):
"""DEPRECATED Print a list of all cloudpipe instances."""
print(CLOUDPIPE_DEPRECATION_WARNING, file=sys.stderr)
cloudpipes = cs.cloudpipe.list()
columns = ['Project Id', "Public IP", "Public Port", "Internal IP"]
utils.print_list(cloudpipes, columns)
@utils.arg(
'project',
metavar='<project_id>',
help=_('UUID of the project to create the cloudpipe for.'))
def do_cloudpipe_create(cs, args):
"""DEPRECATED Create a cloudpipe instance for the given project."""
print(CLOUDPIPE_DEPRECATION_WARNING, file=sys.stderr)
cs.cloudpipe.create(args.project)
@utils.arg('address', metavar='<ip address>', help=_('New IP Address.'))
@utils.arg('port', metavar='<port>', help=_('New Port.'))
def do_cloudpipe_configure(cs, args):
"""DEPRECATED Update the VPN IP/port of a cloudpipe instance."""
print(CLOUDPIPE_DEPRECATION_WARNING, file=sys.stderr)
cs.cloudpipe.update(args.address, args.port)
def _poll_for_status(poll_fn, obj_id, action, final_ok_states, def _poll_for_status(poll_fn, obj_id, action, final_ok_states,
poll_period=5, show_progress=True, poll_period=5, show_progress=True,
status_field="status", silent=False): status_field="status", silent=False):

View File

@ -0,0 +1,6 @@
---
upgrade:
- |
The deprecated ``nova cloudpipe-list``, ``nova cloudpipe-create``, and
``nova cloudpipe-configure`` commands and the ``novaclient.v2.cloudpipe``
API bindings have been removed.