From eec7a55319b3f22949735227199ce49b851519b8 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Wed, 7 Oct 2015 21:50:24 -0700 Subject: [PATCH] Nuke EC2 API from api-paste and remove wsgi support Tempest has already removed the EC2 API tests in: Ib5e24e19bcba9808a9f49fe7f328668df77fe4f9 We have a review in devstack below that removes EC2 API service by default. In this review, we are removing support for the really old EC2 API support in Nova. Anyone who needs EC2 support should use the new EC2-API project: http://git.openstack.org/cgit/openstack/ec2-api/ The necessary changes in Tempest and DevStack are already merged. In a follow on review, will remove the EC2 specific options, code and tests from Nova. DocImpact Change-Id: Id7936be290b6febd18deb4c2db8ea4d678d4d9b1 --- etc/nova/api-paste.ini | 44 +---------------- nova/cmd/api_ec2.py | 48 ------------------- nova/service.py | 2 +- nova/wsgi/nova-ec2-api.py | 46 ------------------ ...move-ec2-api-service-c17a35ed297355b8.yaml | 7 +++ setup.cfg | 1 - 6 files changed, 9 insertions(+), 139 deletions(-) delete mode 100644 nova/cmd/api_ec2.py delete mode 100644 nova/wsgi/nova-ec2-api.py create mode 100644 releasenotes/notes/remove-ec2-api-service-c17a35ed297355b8.yaml diff --git a/etc/nova/api-paste.ini b/etc/nova/api-paste.ini index 7d05f907c458..f7cbc570d5af 100644 --- a/etc/nova/api-paste.ini +++ b/etc/nova/api-paste.ini @@ -6,53 +6,11 @@ use = egg:Paste#urlmap /: meta [pipeline:meta] -pipeline = cors ec2faultwrap logrequest metaapp +pipeline = cors metaapp [app:metaapp] paste.app_factory = nova.api.metadata.handler:MetadataRequestHandler.factory -####### -# EC2 # -####### - -# NOTE: this is now deprecated in favor of https://github.com/openstack/ec2-api -[composite:ec2] -use = egg:Paste#urlmap -/: ec2cloud - -[composite:ec2cloud] -use = call:nova.api.auth:pipeline_factory -noauth2 = cors ec2faultwrap logrequest ec2noauth cloudrequest validator ec2executor -keystone = cors ec2faultwrap logrequest ec2keystoneauth cloudrequest validator ec2executor - -[filter:ec2faultwrap] -paste.filter_factory = nova.api.ec2:FaultWrapper.factory - -[filter:logrequest] -paste.filter_factory = nova.api.ec2:RequestLogging.factory - -[filter:ec2lockout] -paste.filter_factory = nova.api.ec2:Lockout.factory - -[filter:ec2keystoneauth] -paste.filter_factory = nova.api.ec2:EC2KeystoneAuth.factory - -[filter:ec2noauth] -paste.filter_factory = nova.api.ec2:NoAuth.factory - -[filter:cloudrequest] -controller = nova.api.ec2.cloud.CloudController -paste.filter_factory = nova.api.ec2:Requestify.factory - -[filter:authorizer] -paste.filter_factory = nova.api.ec2:Authorizer.factory - -[filter:validator] -paste.filter_factory = nova.api.ec2:Validator.factory - -[app:ec2executor] -paste.app_factory = nova.api.ec2:Executor.factory - ############# # OpenStack # ############# diff --git a/nova/cmd/api_ec2.py b/nova/cmd/api_ec2.py deleted file mode 100644 index 5e3f861e2bf3..000000000000 --- a/nova/cmd/api_ec2.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. -# 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. - -"""Starter script for Nova EC2 API.""" - -import sys - -from oslo_config import cfg -from oslo_log import log as logging -from oslo_reports import guru_meditation_report as gmr - -from nova import config -from nova import objects -from nova import service -from nova import utils -from nova import version - - -CONF = cfg.CONF -CONF.import_opt('enabled_ssl_apis', 'nova.service') - - -def main(): - config.parse_args(sys.argv) - logging.setup(CONF, "nova") - utils.monkey_patch() - objects.register_all() - - gmr.TextGuruMeditation.setup_autorun(version) - - should_use_ssl = 'ec2' in CONF.enabled_ssl_apis - server = service.WSGIService('ec2', use_ssl=should_use_ssl, - max_url_len=16384) - service.serve(server, workers=server.workers) - service.wait() diff --git a/nova/service.py b/nova/service.py index e5137abf0afe..ee79735bf008 100644 --- a/nova/service.py +++ b/nova/service.py @@ -58,7 +58,7 @@ service_opts = [ ' periodic task scheduler to reduce stampeding.' ' (Disable by setting to 0)'), cfg.ListOpt('enabled_apis', - default=['ec2', 'osapi_compute', 'metadata'], + default=['osapi_compute', 'metadata'], help='A list of APIs to enable by default'), cfg.ListOpt('enabled_ssl_apis', default=[], diff --git a/nova/wsgi/nova-ec2-api.py b/nova/wsgi/nova-ec2-api.py deleted file mode 100644 index 15d49d401ee4..000000000000 --- a/nova/wsgi/nova-ec2-api.py +++ /dev/null @@ -1,46 +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. - -"""WSGI script for Nova EC2 API - -EXPERIMENTAL support script for running Nova EC2 API under Apache2 etc. - -""" - -import eventlet - -from oslo_config import cfg -from oslo_log import log as logging -from paste import deploy - -from nova import config -from nova import objects -from nova import service # noqa -from nova import utils - -CONF = cfg.CONF - -config_files = ['/etc/nova/api-paste.ini', '/etc/nova/nova.conf'] -config.parse_args([], default_config_files=config_files) - -LOG = logging.getLogger(__name__) -logging.setup(CONF, "nova") -utils.monkey_patch() -objects.register_all() - -conf = config_files[0] -eventlet.monkey_patch(os=False, thread=False) -name = "ec2" - -options = deploy.appconfig('config:%s' % conf, name=name) - -application = deploy.loadapp('config:%s' % conf, name=name) diff --git a/releasenotes/notes/remove-ec2-api-service-c17a35ed297355b8.yaml b/releasenotes/notes/remove-ec2-api-service-c17a35ed297355b8.yaml new file mode 100644 index 000000000000..9627d5829846 --- /dev/null +++ b/releasenotes/notes/remove-ec2-api-service-c17a35ed297355b8.yaml @@ -0,0 +1,7 @@ +--- +other: + - Nova's EC2 API support which was deprecated in Kilo + (https://wiki.openstack.org/wiki/ReleaseNotes/Kilo#Upgrade_Notes_2) is + removed from Mitaka. This has been replaced by the new ec2-api project + (http://git.openstack.org/cgit/openstack/ec2-api/). + diff --git a/setup.cfg b/setup.cfg index ee030fcbd5b0..0535f2d478e9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,7 +45,6 @@ nova.image.download.modules = console_scripts = nova-all = nova.cmd.all:main nova-api = nova.cmd.api:main - nova-api-ec2 = nova.cmd.api_ec2:main nova-api-metadata = nova.cmd.api_metadata:main nova-api-os-compute = nova.cmd.api_os_compute:main nova-cells = nova.cmd.cells:main