Red Hat Bugzilla – Bug 430114
AMQP XML path hard coded in python examples.
Last modified: 2014-12-01 18:14:18 EST
Description of problem:
The python examples hard-code the spec location like this:
This is ugly. Customers should not even have to know of the existence of the XML
file, and hard coding it makes it impossible to run clients if qpid is installed
anywhere other than /usr/share/amqp (e.g. it could be in /usr/local/share)
I'd suggest that the spec file should not be specified at all in code, but
should be defaulted from
- An environment variable (useful for us and others testing in a mulit-qpid
- The python search path: our installer can substitute the actual installed
location in a small .py file that gets installed on the standard python path.
- /usr/share/amqp if nothing else works.
This also prevents us correctly automating python example interop tests.
Currently they work only if amqp.xml is installed in the hard coded
email@example.com made the required change to the python client, I removed the
redundant code from the demos.
Tested on RHEL 5.3 i386/x86_64 python-qpid-0.5.752581-1.el5
I moved /usr/share/amqp/ to /root/amqp, I changed configuration of /usr/lib/python2.4/site-packages/qpid_config.py and /usr/lib/python2.4/site-packages/qpid/qpid_config.py and I removed *.pyo and *.pyc files. All rhm-docs tests worked fine with this changed configuration. -->VERIFIED