How to study Cinder code?

Asked by Shrirang Phadke

Hi,

I am a newbie to Python and Openstack. I want to study the Cinder code by adding some print statements and DEBUG messages. For that I git cloned the Cinder code, modified it with print statements and build the Cinder code as follows:
1. python setup.py build
2. python setup.py install

The above commands build and install Cinder components. But after that I cannot run Cinder due to some failed dependency or configuration problems.

I followed following online documents in order to build the cinder:
http://rconradharris.com/2013/01/14/getting-cinder-up-and-running.html

Also I followed the followed Cinder Developer guide with no luck:
http://docs.openstack.org/developer/cinder/devref/index.html

Please provide a online resource or any help which will help me in building and deploying modified Cinder code and enable me to debug the code in someway.

Regards,
Shrirang

Question information

Language:
English Edit question
Status:
Answered
For:
Cinder Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Guangya Liu (Jay Lau) (jay-lau-513) said :
#1

1) Install openstack with devstack
2) Once installed finished and cinder was running, if you want to debug, just kill the related cinder process and add pdb.set_trace() to related code, start up the service manually, the process will stop at your break point, you can debug cinder using this way very easily.

Thanks,
Jay

Revision history for this message
Pratik G (pratik-gadiya) said :
#2

Hi Shrirang,

1. You can try out as Jay said to debug the flow of cinder by importing pdb module of python.
2. And also after pdb is attached you can also use traceback module which prints the stack trace(all the previous call till the point where pdb is attached)

    import traceback
    traceback.print_stack()

Thanks,
Pratt

Can you help with this problem?

Provide an answer of your own, or ask Shrirang Phadke for more information if necessary.

To post a message you must log in.