]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Remove duplicated API server
authorKevin Benton <blak111@gmail.com>
Tue, 15 Sep 2015 16:46:05 +0000 (09:46 -0700)
committerKevin Benton <blak111@gmail.com>
Tue, 15 Sep 2015 16:46:05 +0000 (09:46 -0700)
The server in neutron.cmd.eventlet.api was almost exactly the same
as neutron.cmd.eventlet.server.main_wsgi_pecan(). This patch just
gets rid of the former and updates a bash script to reference the
latter.

Change-Id: Ib1ae1d4de9f61bf9eea7e3ceb7fd971195e452e3

neutron/cmd/eventlet/api.py [deleted file]
tools/pecan_server.sh

diff --git a/neutron/cmd/eventlet/api.py b/neutron/cmd/eventlet/api.py
deleted file mode 100644 (file)
index 00a0550..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright 2013 Hewlett-Packard Development Company, L.P.
-# Copyright 2014 Yahoo Inc
-# 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.
-
-# Much of this module is based on the work of the Ironic team
-# see http://git.openstack.org/cgit/openstack/ironic/tree/ironic/cmd/api.py
-
-import logging as std_logging
-import sys
-from wsgiref import simple_server
-
-from oslo_config import cfg
-from oslo_log import log as logging
-from six.moves import socketserver
-
-from neutron.common import config
-from neutron.pecan_wsgi import app
-from neutron.i18n import _LI, _LW
-
-
-CONF = cfg.CONF
-LOG = logging.getLogger(__name__)
-
-
-class ThreadedSimpleServer(socketserver.ThreadingMixIn,
-                           simple_server.WSGIServer):
-    """A Mixin class to make the API service greenthread-able."""
-    pass
-
-
-def main():
-    config.init(sys.argv[1:])
-    config.setup_logging()
-    application = app.setup_app()
-
-    host = CONF.bind_host
-    port = CONF.bind_port
-
-    wsgi = simple_server.make_server(
-        host,
-        port,
-        application,
-        server_class=ThreadedSimpleServer
-    )
-
-    LOG.warning(
-        _LW("Stand-alone Server Serving on http://%(host)s:%(port)s"),
-        {'host': host, 'port': port}
-    )
-    LOG.info(_LI("Configuration:"))
-    CONF.log_opt_values(LOG, std_logging.INFO)
-
-    try:
-        wsgi.serve_forever()
-    except KeyboardInterrupt:
-        pass
index ef4709aae9a39c148cbe62e718b23620c4351907..ef36919806424ca3a676c5c721b1213ef7220cca 100755 (executable)
@@ -27,7 +27,7 @@ fi
 
 DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../
 source "$DIR/.tox/py27/bin/activate"
-COMMAND="python -c 'from neutron.cmd.eventlet import api; api.main()'"
+COMMAND="python -c 'from neutron.cmd.eventlet import server; server.main_wsgi_pecan()'"
 
 function cleanup() {
   kill $PID