Ask Your Question
1

Best way to debug openstack and its components

asked 2015-11-09 03:02:41 -0500

cooldharma06 gravatar image

hi all,

i am trying to debug and find the flow of source code. what is the best and advisable way to debug openstack and its components.

pudb or eclipse + pydev which is the best one. kindly suggest me.

thanks & regards,

cooldharma06

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2015-11-09 22:22:58 -0500

shashidhar gravatar image

updated 2015-11-09 22:24:22 -0500

It depends on mode of debugging that you are interested in local/remote. But in any way, go through the following article which neatly explains on how to use eclipse and PyDev for debugging OpenStack.

http://debugopenstack.blogspot.in/

Debug Openstack code Local / Remote with Eclipse and PyDev

Google around for last few days to figure out following:

Is it possible to debug openstack code end-to-end?
Should I debug locally (everything configure inside eclipse)?
How to debug remotely running openstack services?Or, combination of above two?
What developer tools/IDEs to use for debugging? (eclipse +pydev, pdb, winpdb, pycharm)?
What’s the best/easiest/more sophisticated method, to get set everything quickly?

And there’s bunch of other questions, followed by multiple alternatives to chose from.

Here in this post, I have tried with Eclipse and pydev plug-in

Development Environment: Linux Distro: centos/ ubuntu, (I used VM workstation) Install eclipse as per os type 32/64 bit on one of the VM: http://www.eclipse.org/ Install pydev plugin: http://pydev.org/manual_101_install.html Configure python Interpreter in eclipse. Install git plugin (only for local debug): http://download.eclipse.org/egit/updates, add this in Help-> install new software

Local Debugging:

To begin with, you can try with keystone in eclipse. Check out: http://wiki.openstack.org/Setup%20key... Also, setup environment variables under debug configuration for keystone service to pick up. OS_USERNAME, OS_PASSWORD, OS_TENANT_NAME, OS_REGION_NAME, OS_AUTH_URL

Optionally, Setup keystone.conf file as argument under debug configuration dialog.

For example, to test setup, put a break-point at:
File: keystone/identity/core.py Method: def get_all_tenants(self, context, **kw): Now, execute keystone-all (debug as-> python run) from eclipse As you have already install keystoneclient by following above link, from terminal execute:

$keystone tenant-list

(check db is running, iptables service not blocking port – just in case if get 500 error with tenant-list)

This should hit break-point in keystone service running in eclipse and ask to move to debug perspective.

Voila, setup for local debugging.

Remote Debugging:

Development Environment:

In this cae, have used two VMs, one is centos and other is ubuntu 12.04. Ubuntu VM- running eclipse IDE with pydev plug-in. Centos VM - openstack services running. Configure python Interpreter in eclipse. Configure pydev debug server in eclipse.

To Remote debug, following link has most of the answers: http://pydev.org/manual_adv_remote_de...

copy /pysrc directory from ubuntu vm to centos vm.

/pysrc – will be found in eclipse installation plugins/org.python.pydev_<version>/pysrc

On centos (Remote machine), preferred place to copy under python site-package. Ex: /usr/lib/python2.6/site-packages/pysrc/

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-11-09 03:02:41 -0500

Seen: 927 times

Last updated: Nov 09 '15