Eclipse + pydev debug openstack
1. Install eclipse to debug openstack.
2. Install the pydev plug-in on eclipse:
Window-> preferences-> general-> networkconnect
Activeprovider: manual
Editproxy entry: schema: http, host: 127.0.0.1, port: 8123,
Help-> installnew software-> work with: pydev-http://pydev.org/updates
Select the pydev version corresponding to the python version in the system.
Cancel "show only the latestversions of available software"
Next-> finish
3. (copy the openstack source code built in the virtual machine to "my_openstack" in the local eclipse workspace project ")
File-> new-> pydevproject-> project name: my_openstack
Cancel "use default"
Select the directory "/root/workspace/my_openstack"
Grammarversion: corresponding to the python version
Iterpreter: python
"Addproject directory to the PYTHONPATH"
Finish
4. Copy the eclipse \ plugins \ org. python. pydev_x.x.x \ pysrc directory to the Virtual Machine "/home/pysrc"
5. Modify pydev_file_utils.py in pysrc of the VM:
PATHS_FROM_ECLIPSE_TO_PYTHON = [(R'/root/soft/eclipse_jck/plugins/org. python. pydev_2.6.0.2012062818/pysrc/', R'/home/panfy/pysrc/'), (R'/root/workspace/pydev_openstack /', r'/usr/lib/python2.7/site-packages/')]
DEBUG_CLIENT_SERVER_TRANSLATION = True
6. Modify the openstack code of the VM:
For example, you need to debug ceilometerclient.
Modify shell. py in ceilometerclient
Importsys
Sys. path. append ('/home/pysrc ')
Add import pydevd; pydevd. settrace ('10. 167.225.103 ') to the IP address of the local host.
To the beginning of the debugging
7. In eclipse:
* Debug-> start the debugging service: pydev: start the pydevserver
Prompt "debug server at port: 5678" appears
8. Execute the corresponding commands in the virtual machine to trigger debugging.