Closed tcmitchell closed 8 years ago
The WSGI config in apache needs to be updated. We cannot use WSGIPythonPath
in daemon mode, so instead use the python-path
argument to WSGIDaemonProcess
:
WSGIDaemonProcess ch_server display-name=%{GROUP} python-path=/usr/share/geni-ch/chapi/chapi:/usr/share/geni-ch/chapi/chapi/tools:/usr/share/geni-ch/gcf/src
With that in place we no longer need to set the basic paths via sys.path
in ch_server.wsgi
.
Imports are happening via different paths in
sys.path
(set inch_server.wsgi
). For example, Exceptions.py is imported as eitherplugins.chapiv1rpc.chapi.Exceptions
or aschapi.Exceptions
. This causesisinstance
to fail unexpectedly in some (but not all) cases. This is because both/usr/share/geni-ch/chapi/chapi
and/usr/share/geni-ch/chapi/chapi/plugins/chapiv1rpc
are on the path and Exceptions is sometimes imported aschapi.Exceptions
(e.g.SAv1PersistentImplementation.py
).Straighten out the directories in
sys.path
, then make the import statements match. I recommend including only the top level directory (/usr/share/geni-ch/chapi/chapi
, but use automake replacement) in thesys.path
, and then importing as eitherplugins.foo.bar
ortools.foo.bar
.A meta question: should
sys.path
be set bych_server.wsgi
at all? Or should the path be set in WSGI config instead?