Neutron WSGI API server

Since OpenStack Epoxy (2025.1), the Neutron API server only runs using a uWSGI server that loads the Neutron WSGI application. The configuration and modules needed and how to execute the Neutron API using WSGI is described in WSGI Usage with the Neutron API. The eventlet API server is no longer supported and the code will be removed.

With the older implementation (eventlet API server) it was easy to create an entry script to start the Neutron API, using the same code as in the generated script defined in the [entry_points]console_script section. That script started a python executable; it was possible to add break points (using pdb) or create a profile for PyCharm, for example.

In the WSGI case this is a bit more complicated. It is not possible to attach a Python debugger to the running process because this is not a Python executable. The uWSGI server, when a request is received, uses the application entry point to route the request, but the root process is not a Python executable.

rpdb

An alternative to pdb is the use of rpdb <https://pypi.org/project/rpdb/>. This library works the same as pdb but opening a TCP port that can be accessed using telnet, netcat, etc. For example:

import rpdb
debugger = rpdb.Rpdb(addr='0.0.0.0', port=12345)
debugger.set_trace()

To access to the remote PDB console, it is needed to execute the following command:

$ telnet localhost 12345